Test::More = 0.88
Test::Exception = 0
Scalar::Util = 0
+Test::Requires = 0.05
[@Git]
use strict;
use warnings;
-use Test::More;
+use Test::More tests => 2;
{
package MyClass;
MyClass->inc_counter();
is( MyClass->counter(), 1 );
-done_testing();
use strict;
use warnings;
-use Test::More;
+use Test::More tests => 2;
+
+use Test::Requires {
+ 'MooseX::AttributeHelpers' => 0.23, # skip all if not installed
+};
-BEGIN {
- eval "use MooseX::AttributeHelpers 0.23;";
- plan skip_all => 'This test requires MooseX::AttributeHelpers 0.23+'
- if $@;
-}
{
package MyClass;
MyClass->inc_counter();
is( MyClass->counter(), 1 );
-done_testing();
use strict;
use warnings;
-use Test::More;
+
+use Test::More tests => 3;
use Test::Exception;
-BEGIN {
- unless (eval { require MooseX::Role::Parameterized }) {
- plan skip_all => 'This test needs MooseX::Role::Parameterized';
- }
-}
+use Test::Requires {
+ 'MooseX::Role::Parameterized' => 0.23, # skip all if not installed
+};
{
package Role;
is $instance->foo, 'bar';
} 'used class attribute from parameterized role';
-done_testing;
use strict;
use warnings;
-use Test::More;
+
+use Test::More tests => 1;
use Test::Exception;
lives_ok {
Bar->new->_connections;
} 'finds a class attribute under role composition';
-done_testing;
BEGIN {