summaryrefslogtreecommitdiff
path: root/t/cmop/deprecated.t
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2015-06-06 17:50:16 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2015-06-06 17:50:16 +0000
commit5ac2026f7eed78958d69d051e7a8e993dcf51205 (patch)
tree298c3d2f08bdfe5689998b11892d72a897985be1 /t/cmop/deprecated.t
downloadMoose-tarball-master.tar.gz
Diffstat (limited to 't/cmop/deprecated.t')
-rw-r--r--t/cmop/deprecated.t31
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;