4 use Test::More 'no_plan';
6 use lib "$FindBin::Bin/lib";
8 use constant NO_SUCH_FILE => "crickey_mate_this_file_isnt_here_either";
10 use autodie::test::au qw(open);
13 open(my $fh, '<', NO_SUCH_FILE);
16 ok(my $e = $@, 'Strewth! autodie::test::au should throw an exception on failure');
18 isa_ok($e, 'autodie::test::au::exception',
19 'Yeah mate, that should be our test exception.');
21 like($e, qr/time for a beer/, "Time for a beer mate?");
23 like( eval { $e->time_for_a_beer; },
24 qr/time for a beer/, "It's always a good time for a beer."
27 ok($e->matches('open'), "Should be a fair dinkum error from open");