From: Dave Rolsky Date: Thu, 1 Oct 2009 19:03:36 +0000 (-0500) Subject: Clean up this test (tidy, improve test descriptions) X-Git-Tag: 0.95~12 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e8f79d90c50ec879352c2d85be3164c941f036c0;p=gitmo%2FClass-MOP.git Clean up this test (tidy, improve test descriptions) --- diff --git a/t/500_deprecated.t b/t/500_deprecated.t index 2914ecc..b97ddc9 100755 --- a/t/500_deprecated.t +++ b/t/500_deprecated.t @@ -10,47 +10,41 @@ $SIG{__WARN__} = \&croak; { package Foo; - use Test::More; - use Test::Exception; - throws_ok { + ::throws_ok{ Class::MOP::in_global_destruction(); - } qr/\b deprecated \b/xmsi, 'complained'; + } qr/\b deprecated \b/xmsi, + 'Class::MOP::in_global_destruction is deprecated'; } { package Bar; - use Test::More; - use Test::Exception; use Class::MOP::Deprecated -compatible => 0.93; - throws_ok { + ::throws_ok{ Class::MOP::in_global_destruction(); - } qr/\b deprecated \b/xmsi, 'complained'; + } qr/\b deprecated \b/xmsi, + 'Class::MOP::in_global_destruction is deprecated with 0.93 compatibility'; } { package Baz; - use Test::More; - use Test::Exception; use Class::MOP::Deprecated -compatible => 0.92; - lives_ok { + ::lives_ok{ Class::MOP::in_global_destruction(); - } 'safe'; + } + 'Class::MOP::in_global_destruction is not deprecated with 0.92 compatibility'; } - { package Baz::Inner; - use Test::More; - use Test::Exception; - lives_ok { + ::lives_ok{ Class::MOP::in_global_destruction(); - } 'safe in an inner class'; + } 'safe in an inner class'; } { @@ -68,9 +62,13 @@ $SIG{__WARN__} = \&croak; my $map = Quux->meta->get_method_map; my @method_objects = grep { blessed($_) } values %{$map}; - ::is( scalar @method_objects, 3, - 'get_method_map still returns all values as method object' ); - ::is_deeply( [ sort keys %{$map} ], - [ qw( bar foo meta ) ], - 'get_method_map returns expected methods' ); + ::is( + scalar @method_objects, 3, + 'get_method_map still returns all values as method object' + ); + ::is_deeply( + [ sort keys %{$map} ], + [qw( bar foo meta )], + 'get_method_map returns expected methods' + ); }