diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2015-06-06 17:50:16 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2015-06-06 17:50:16 +0000 |
commit | 5ac2026f7eed78958d69d051e7a8e993dcf51205 (patch) | |
tree | 298c3d2f08bdfe5689998b11892d72a897985be1 /t/exceptions/moose-meta-role-application.t | |
download | Moose-tarball-5ac2026f7eed78958d69d051e7a8e993dcf51205.tar.gz |
Moose-2.1405HEADMoose-2.1405master
Diffstat (limited to 't/exceptions/moose-meta-role-application.t')
-rw-r--r-- | t/exceptions/moose-meta-role-application.t | 121 |
1 files changed, 121 insertions, 0 deletions
diff --git a/t/exceptions/moose-meta-role-application.t b/t/exceptions/moose-meta-role-application.t new file mode 100644 index 0000000..b1ccf62 --- /dev/null +++ b/t/exceptions/moose-meta-role-application.t @@ -0,0 +1,121 @@ +use strict; +use warnings; + +use Test::More; +use Test::Fatal; + +use Moose::Meta::Role::Application; + +{ + my $exception = exception { + Moose::Meta::Role::Application->check_role_exclusions; + }; + + like( + $exception, + qr/Abstract method/, + "cannot call an abstract method"); + + isa_ok( + $exception, + "Moose::Exception::CannotCallAnAbstractMethod", + "cannot call an abstract method"); +} + +{ + my $exception = exception { + Moose::Meta::Role::Application->check_required_methods; + }; + + like( + $exception, + qr/Abstract method/, + "cannot call an abstract method"); + + isa_ok( + $exception, + "Moose::Exception::CannotCallAnAbstractMethod", + "cannot call an abstract method"); +} + +{ + my $exception = exception { + Moose::Meta::Role::Application->check_required_attributes; + }; + + like( + $exception, + qr/Abstract method/, + "cannot call an abstract method"); + + isa_ok( + $exception, + "Moose::Exception::CannotCallAnAbstractMethod", + "cannot call an abstract method"); +} + +{ + my $exception = exception { + Moose::Meta::Role::Application->apply_attributes; + }; + + like( + $exception, + qr/Abstract method/, + "cannot call an abstract method"); + + isa_ok( + $exception, + "Moose::Exception::CannotCallAnAbstractMethod", + "cannot call an abstract method"); +} + +{ + my $exception = exception { + Moose::Meta::Role::Application->apply_methods; + }; + + like( + $exception, + qr/Abstract method/, + "cannot call an abstract method"); + + isa_ok( + $exception, + "Moose::Exception::CannotCallAnAbstractMethod", + "cannot call an abstract method"); +} + +{ + my $exception = exception { + Moose::Meta::Role::Application->apply_override_method_modifiers; + }; + + like( + $exception, + qr/Abstract method/, + "cannot call an abstract method"); + + isa_ok( + $exception, + "Moose::Exception::CannotCallAnAbstractMethod", + "cannot call an abstract method"); +} + +{ + my $exception = exception { + Moose::Meta::Role::Application->apply_method_modifiers; + }; + + like( + $exception, + qr/Abstract method/, + "cannot call an abstract method"); + + isa_ok( + $exception, + "Moose::Exception::CannotCallAnAbstractMethod", + "cannot call an abstract method"); +} + +done_testing; |