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/cmop/deprecated.t | |
download | Moose-tarball-master.tar.gz |
Moose-2.1405HEADMoose-2.1405master
Diffstat (limited to 't/cmop/deprecated.t')
-rw-r--r-- | t/cmop/deprecated.t | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/t/cmop/deprecated.t b/t/cmop/deprecated.t new file mode 100644 index 0000000..b29649b --- /dev/null +++ b/t/cmop/deprecated.t @@ -0,0 +1,31 @@ +use strict; +use warnings; + +use Test::More; +use Class::MOP; + +use lib 't/cmop/lib'; + +{ + my $warnings; + local $SIG{__WARN__} = sub { $warnings .= $_[0] }; + Class::MOP::load_class('BinaryTree'); + like($warnings, qr/^Class::MOP::load_class is deprecated/); + ok(Class::MOP::does_metaclass_exist('BinaryTree')); +} + +{ + my $warnings; + local $SIG{__WARN__} = sub { $warnings .= $_[0] }; + ok(Class::MOP::is_class_loaded('BinaryTree')); + like($warnings, qr/^Class::MOP::is_class_loaded is deprecated/); +} + +{ + my $warnings; + local $SIG{__WARN__} = sub { $warnings .= $_[0] }; + is(Class::MOP::load_first_existing_class('this::class::probably::doesnt::exist', 'MyMetaClass'), 'MyMetaClass'); + like($warnings, qr/^Class::MOP::load_first_existing_class is deprecated/); +} + +done_testing; |