use strict;
use warnings;
-use Test::More tests => 6;
-use Test::Exception;
+use Test::More;
+use Test::Fatal;
use Carp;
{
package Foo;
- ::throws_ok{
+ ::like( ::exception {
Class::MOP::in_global_destruction();
- } qr/\b deprecated \b/xmsi,
- 'Class::MOP::in_global_destruction is deprecated';
+ }, qr/\b deprecated \b/xmsi, 'Class::MOP::in_global_destruction is deprecated' );
}
{
package Bar;
- use Class::MOP::Deprecated -compatible => 0.93;
+ use Class::MOP::Deprecated -api_version => 0.93;
- ::throws_ok{
+ ::like( ::exception {
Class::MOP::in_global_destruction();
- } qr/\b deprecated \b/xmsi,
- 'Class::MOP::in_global_destruction is deprecated with 0.93 compatibility';
+ }, qr/\b deprecated \b/xmsi, 'Class::MOP::in_global_destruction is deprecated with 0.93 compatibility' );
}
{
package Baz;
- use Class::MOP::Deprecated -compatible => 0.92;
+ use Class::MOP::Deprecated -api_version => 0.92;
- ::lives_ok{
+ ::is( ::exception {
Class::MOP::in_global_destruction();
- }
- 'Class::MOP::in_global_destruction is not deprecated with 0.92 compatibility';
+ }, undef, 'Class::MOP::in_global_destruction is not deprecated with 0.92 compatibility' );
}
{
- package Baz::Inner;
+ package Foo2;
- ::lives_ok{
- Class::MOP::in_global_destruction();
- } 'safe in an inner class';
+ use metaclass;
+
+ ::like( ::exception { Foo2->meta->get_attribute_map }, qr/\Qget_attribute_map method has been deprecated/, 'get_attribute_map is deprecated' );
}
{
package Quux;
- use Class::MOP::Deprecated -compatible => 0.92;
+ use Class::MOP::Deprecated -api_version => 0.92;
use Scalar::Util qw( blessed );
use metaclass;
'get_method_map returns expected methods'
);
}
+
+done_testing;