Skip to content

Commit

Permalink
*_method_ok() against superclass methods
Browse files Browse the repository at this point in the history
  • Loading branch information
rsrchboy committed Mar 21, 2017
1 parent 9837a2b commit 38587c7
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions t/method_ok.t
@@ -1,8 +1,9 @@
use strict;
use warnings;

{ package TestRole; use Moose::Role; sub role { }; has role_att => (is => 'ro') }
{ package TestClass; use Moose; sub foo { }; has beep => (is => 'ro') }
{ package TestRole; use Moose::Role; sub role { }; has role_att => (is => 'ro') }
{ package TestClass; use Moose; sub foo { }; has beep => (is => 'ro') }
{ package TC2; use Moose; extends 'TestClass'; sub bar { } }

use Test::Builder::Tester;
use Test::More;
Expand All @@ -24,8 +25,17 @@ subtest sanity => sub {
has_method_ok TestClass => 'beep';
has_no_method_ok TestClass => 'bar';

subtest multiple => sub { has_method_ok TestClass => 'beep', 'foo' };
subtest multiple => sub {
has_method_ok TestClass => 'beep', 'foo';
has_no_method_ok TestClass => 'boop', 'bar';
};

subtest from_role => sub { has_no_method_ok TestClass => 'role', 'role_att' };

subtest superclass => sub {
has_method_ok TC2 => 'bar';
has_no_method_ok TC2 => qw{ foo beep role role_att };
};
};

test_out 'ok 1 - TestClass has method foo';
Expand Down

0 comments on commit 38587c7

Please sign in to comment.