Skip to content

Commit

Permalink
added more loader tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Oct 9, 2011
1 parent 0886e76 commit f4c15a0
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions t/mojo/loader.t
@@ -1,7 +1,7 @@
#!/usr/bin/env perl
use Mojo::Base -strict;

use Test::More tests => 44;
use Test::More tests => 47;

use FindBin;
use lib "$FindBin::Bin/lib";
Expand All @@ -14,9 +14,14 @@ use IO::File;
# Ow. OW. Oh, they're defending themselves somehow."
use_ok 'Mojo::Loader';

# Exception
# Single character core module
my $loader = Mojo::Loader->new;
my $e = $loader->load('LoaderException');
ok !UNIVERSAL::can(B => 'svref_2object');
ok !$loader->load('B');
ok !!UNIVERSAL::can(B => 'svref_2object');

# Exception
my $e = $loader->load('LoaderException');
isa_ok $e, 'Mojo::Exception', 'right object';
like $e->message, qr/Missing right curly/, 'right message';
is $e->lines_before->[0]->[0], 5, 'right line';
Expand Down

0 comments on commit f4c15a0

Please sign in to comment.