Skip to content

Commit

Permalink
more Mojo::Base tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Apr 2, 2012
1 parent fc19891 commit 23df174
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions t/mojo/base.t
@@ -1,6 +1,6 @@
use Mojo::Base -strict;

use Test::More tests => 409;
use Test::More tests => 413;

use FindBin;
use lib "$FindBin::Bin/lib";
Expand All @@ -20,6 +20,9 @@ __PACKAGE__->attr('name');
package BaseTestTest;
use Mojo::Base 'BaseTest';

package BaseTestTestTest;
use Mojo::Base 'BaseTestTest';

package main;

use Mojo::Base;
Expand All @@ -40,10 +43,14 @@ for my $i (51 .. 100) {
}

# Instance method
my $monkey = BaseTest->new;
my $monkey = BaseTestTestTest->new;
$monkey->attr('mojo');
$monkey->mojo(23);
is $monkey->mojo, 23, 'monkey has mojo';
ok !BaseTestTest->can('mojo'), 'base class does not have mojo';
ok(BaseTestTest->can('heads'), 'base class has heads');
ok !BaseTest->can('mojo'), 'base class does not have mojo';
ok(BaseTest->can('heads'), 'base class has heads');

# "default" defined but false
my $m = $monkeys->[1];
Expand Down

0 comments on commit 23df174

Please sign in to comment.