X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F017_add_method_modifier.t;h=646c3967800eaa4367199419c00b65a40e2dc73f;hb=195f5bf802be0d32838ddb6077866a5951c1d918;hp=7ac25f6b20a5e79d4eaf167e9d4d55c56e8dd56d;hpb=fd662d66ae039fddacc0593f1bf732fb843c3a19;p=gitmo%2FClass-MOP.git diff --git a/t/017_add_method_modifier.t b/t/017_add_method_modifier.t index 7ac25f6..646c396 100644 --- a/t/017_add_method_modifier.t +++ b/t/017_add_method_modifier.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More tests => 17; +use Test::More tests => 20; use Test::Exception; BEGIN { @@ -63,6 +63,8 @@ BEGIN { }); ::ok(CheckingAccount->meta->has_method('withdraw'), '... checking account now has a withdraw method'); + ::isa_ok(CheckingAccount->meta->get_method('withdraw'), 'Class::MOP::Method::Wrapped'); + ::isa_ok(BankAccount->meta->get_method('withdraw'), 'Class::MOP::Method'); } @@ -74,6 +76,10 @@ lives_ok { $savings_account->withdraw(50); } '... withdrew from savings successfully'; is($savings_account->balance, 200, '... got the right savings balance after withdrawl'); +dies_ok { + $savings_account->withdraw(250); +} '... could not withdraw from savings successfully'; + $savings_account->deposit(150); is($savings_account->balance, 350, '... got the right savings balance after deposit');