From: Dave Rolsky Date: Fri, 14 Nov 2008 21:35:18 +0000 (+0000) Subject: got rid of all the use_ok junk except for 000_load.t X-Git-Tag: 0.70~3 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=efd3d14c1cf03120dfd1ed7787f8050e55bb8319;p=gitmo%2FClass-MOP.git got rid of all the use_ok junk except for 000_load.t --- diff --git a/t/001_basic.t b/t/001_basic.t index f4e65d0..a32333d 100644 --- a/t/001_basic.t +++ b/t/001_basic.t @@ -3,13 +3,11 @@ use strict; use warnings; -use Test::More tests => 25; +use Test::More tests => 23; use Test::Exception; -BEGIN { - use_ok('Class::MOP'); - use_ok('Class::MOP::Class'); -} +use Class::MOP; +use Class::MOP::Class; { package Foo; diff --git a/t/002_class_precedence_list.t b/t/002_class_precedence_list.t index 2abfeb7..28d3291 100644 --- a/t/002_class_precedence_list.t +++ b/t/002_class_precedence_list.t @@ -3,12 +3,10 @@ use strict; use warnings; -use Test::More tests => 8; +use Test::More tests => 6; -BEGIN { - use_ok('Class::MOP'); - use_ok('Class::MOP::Class'); -} +use Class::MOP; +use Class::MOP::Class; =pod diff --git a/t/004_advanced_methods.t b/t/004_advanced_methods.t index 392ff39..d3fba8e 100644 --- a/t/004_advanced_methods.t +++ b/t/004_advanced_methods.t @@ -3,13 +3,11 @@ use strict; use warnings; -use Test::More tests => 14; +use Test::More tests => 12; use Test::Exception; -BEGIN { - use_ok('Class::MOP'); - use_ok('Class::MOP::Class'); -} +use Class::MOP; +use Class::MOP::Class; =pod diff --git a/t/005_attributes.t b/t/005_attributes.t index 62d54f4..770991d 100644 --- a/t/005_attributes.t +++ b/t/005_attributes.t @@ -3,12 +3,10 @@ use strict; use warnings; -use Test::More tests => 71; +use Test::More tests => 70; use Test::Exception; -BEGIN { - use_ok('Class::MOP'); -} +use Class::MOP; my $FOO_ATTR = Class::MOP::Attribute->new('$foo'); my $BAR_ATTR = Class::MOP::Attribute->new('$bar' => ( diff --git a/t/006_new_and_clone_metaclasses.t b/t/006_new_and_clone_metaclasses.t index b64119d..086c6db 100644 --- a/t/006_new_and_clone_metaclasses.t +++ b/t/006_new_and_clone_metaclasses.t @@ -6,12 +6,10 @@ use warnings; use FindBin; use File::Spec::Functions; -use Test::More tests => 36; +use Test::More tests => 35; use Test::Exception; -BEGIN { - use_ok('Class::MOP'); -} +use Class::MOP; use lib catdir($FindBin::Bin, 'lib'); diff --git a/t/010_self_introspection.t b/t/010_self_introspection.t index 48e6ab6..748500d 100644 --- a/t/010_self_introspection.t +++ b/t/010_self_introspection.t @@ -3,15 +3,13 @@ use strict; use warnings; -use Test::More tests => 236; +use Test::More tests => 232; use Test::Exception; -BEGIN { - use_ok('Class::MOP'); - use_ok('Class::MOP::Class'); - use_ok('Class::MOP::Package'); - use_ok('Class::MOP::Module'); -} +use Class::MOP; +use Class::MOP::Class; +use Class::MOP::Package; +use Class::MOP::Module; { my $class = Class::MOP::Class->initialize('Foo'); diff --git a/t/011_create_class.t b/t/011_create_class.t index 874c81b..c30ddb7 100644 --- a/t/011_create_class.t +++ b/t/011_create_class.t @@ -3,12 +3,10 @@ use strict; use warnings; -use Test::More tests => 28; +use Test::More tests => 27; use Test::Exception; -BEGIN { - use_ok('Class::MOP'); -} +use Class::MOP; my $Point = Class::MOP::Class->create('Point' => ( version => '0.01', diff --git a/t/012_package_variables.t b/t/012_package_variables.t index 9509898..8df0668 100644 --- a/t/012_package_variables.t +++ b/t/012_package_variables.t @@ -3,12 +3,10 @@ use strict; use warnings; -use Test::More tests => 87; +use Test::More tests => 86; use Test::Exception; -BEGIN { - use_ok('Class::MOP'); -} +use Class::MOP; { package Foo; diff --git a/t/013_add_attribute_alternate.t b/t/013_add_attribute_alternate.t index 03d6d16..23ea0fe 100644 --- a/t/013_add_attribute_alternate.t +++ b/t/013_add_attribute_alternate.t @@ -3,12 +3,10 @@ use strict; use warnings; -use Test::More tests => 28; +use Test::More tests => 27; use Test::Exception; -BEGIN { - use_ok('Class::MOP'); -} +use Class::MOP; { package Point; diff --git a/t/014_attribute_introspection.t b/t/014_attribute_introspection.t index f9c8bb1..b02cfeb 100644 --- a/t/014_attribute_introspection.t +++ b/t/014_attribute_introspection.t @@ -3,12 +3,10 @@ use strict; use warnings; -use Test::More tests => 63; +use Test::More tests => 62; use Test::Exception; -BEGIN { - use_ok('Class::MOP'); -} +use Class::MOP; { my $attr = Class::MOP::Attribute->new('$test'); diff --git a/t/015_metaclass_inheritance.t b/t/015_metaclass_inheritance.t index f8ac55d..20f7364 100644 --- a/t/015_metaclass_inheritance.t +++ b/t/015_metaclass_inheritance.t @@ -3,12 +3,10 @@ use strict; use warnings; -use Test::More tests => 10; +use Test::More tests => 9; use Test::Exception; -BEGIN { - use_ok('Class::MOP'); -} +use Class::MOP; =pod diff --git a/t/016_class_errors_and_edge_cases.t b/t/016_class_errors_and_edge_cases.t index 2d2eb7f..6365594 100644 --- a/t/016_class_errors_and_edge_cases.t +++ b/t/016_class_errors_and_edge_cases.t @@ -3,12 +3,10 @@ use strict; use warnings; -use Test::More tests => 49; +use Test::More tests => 48; use Test::Exception; -BEGIN { - use_ok('Class::MOP'); -} +use Class::MOP; { dies_ok { diff --git a/t/017_add_method_modifier.t b/t/017_add_method_modifier.t index e2e4422..079d921 100644 --- a/t/017_add_method_modifier.t +++ b/t/017_add_method_modifier.t @@ -3,12 +3,10 @@ use strict; use warnings; -use Test::More tests => 20; +use Test::More tests => 19; use Test::Exception; -BEGIN { - use_ok('Class::MOP'); -} +use Class::MOP; { package BankAccount; diff --git a/t/018_anon_class.t b/t/018_anon_class.t index 25151b7..925d4bc 100644 --- a/t/018_anon_class.t +++ b/t/018_anon_class.t @@ -3,12 +3,10 @@ use strict; use warnings; -use Test::More tests => 19; +use Test::More tests => 18; use Test::Exception; -BEGIN { - use_ok('Class::MOP'); -} +use Class::MOP; { package Foo; diff --git a/t/019_anon_class_keep_alive.t b/t/019_anon_class_keep_alive.t index 59422be..00cbbf3 100644 --- a/t/019_anon_class_keep_alive.t +++ b/t/019_anon_class_keep_alive.t @@ -3,12 +3,10 @@ use strict; use warnings; -use Test::More tests => 11; +use Test::More tests => 10; use Test::Exception; -BEGIN { - use_ok('Class::MOP'); -} +use Class::MOP; my $anon_class_name; my $anon_meta_name; diff --git a/t/021_attribute_errors_and_edge_cases.t b/t/021_attribute_errors_and_edge_cases.t index da28766..aad2a34 100644 --- a/t/021_attribute_errors_and_edge_cases.t +++ b/t/021_attribute_errors_and_edge_cases.t @@ -3,12 +3,10 @@ use strict; use warnings; -use Test::More tests => 29; +use Test::More tests => 27; use Test::Exception; -BEGIN { - use_ok('Class::MOP'); - use_ok('Class::MOP::Attribute'); +BEGIN {use Class::MOP;use Class::MOP::Attribute; } # most values are static diff --git a/t/022_attribute_duplication.t b/t/022_attribute_duplication.t index b324658..e68b75b 100644 --- a/t/022_attribute_duplication.t +++ b/t/022_attribute_duplication.t @@ -5,11 +5,9 @@ use warnings; use Scalar::Util; -use Test::More tests => 17; +use Test::More tests => 16; -BEGIN { - use_ok('Class::MOP'); -} +use Class::MOP; =pod diff --git a/t/023_attribute_get_read_write.t b/t/023_attribute_get_read_write.t index 0bf8290..d112536 100644 --- a/t/023_attribute_get_read_write.t +++ b/t/023_attribute_get_read_write.t @@ -5,11 +5,9 @@ use warnings; use Scalar::Util 'blessed', 'reftype'; -use Test::More tests => 37; +use Test::More tests => 36; -BEGIN { - use_ok('Class::MOP'); -} +use Class::MOP; =pod diff --git a/t/024_attribute_initializer.t b/t/024_attribute_initializer.t index c3cfc89..b982bf1 100644 --- a/t/024_attribute_initializer.t +++ b/t/024_attribute_initializer.t @@ -5,11 +5,9 @@ use warnings; use Scalar::Util 'blessed', 'reftype'; -use Test::More tests => 10; +use Test::More tests => 9; -BEGIN { - use_ok('Class::MOP'); -} +use Class::MOP; =pod diff --git a/t/040_metaclass.t b/t/040_metaclass.t index 190d8b0..0cf20f9 100644 --- a/t/040_metaclass.t +++ b/t/040_metaclass.t @@ -3,10 +3,9 @@ use strict; use warnings; -use Test::More tests => 12; +use Test::More tests => 11; -BEGIN { - use_ok('metaclass'); +BEGIN {use metaclass; } { diff --git a/t/041_metaclass_incompatibility.t b/t/041_metaclass_incompatibility.t index ad33963..d156c80 100644 --- a/t/041_metaclass_incompatibility.t +++ b/t/041_metaclass_incompatibility.t @@ -3,10 +3,9 @@ use strict; use warnings; -use Test::More tests => 7; +use Test::More tests => 6; -BEGIN { - use_ok('metaclass'); +BEGIN {use metaclass; } # meta classes diff --git a/t/042_metaclass_incompatibility_dyn.t b/t/042_metaclass_incompatibility_dyn.t index 8608bb3..2c6195c 100644 --- a/t/042_metaclass_incompatibility_dyn.t +++ b/t/042_metaclass_incompatibility_dyn.t @@ -3,10 +3,9 @@ use strict; use warnings; -use Test::More tests => 7; +use Test::More tests => 6; -BEGIN { - use_ok('metaclass'); +BEGIN {use metaclass; } # meta classes diff --git a/t/043_instance_metaclass_incompat.t b/t/043_instance_metaclass_incompat.t index 3e64164..2fb4b30 100644 --- a/t/043_instance_metaclass_incompat.t +++ b/t/043_instance_metaclass_incompat.t @@ -3,10 +3,9 @@ use strict; use warnings; -use Test::More tests => 7; +use Test::More tests => 6; -BEGIN { - use_ok('metaclass'); +BEGIN {use metaclass; } # meta classes diff --git a/t/044_instance_metaclass_incompat_dyn.t b/t/044_instance_metaclass_incompat_dyn.t index 9587930..e85e742 100644 --- a/t/044_instance_metaclass_incompat_dyn.t +++ b/t/044_instance_metaclass_incompat_dyn.t @@ -3,10 +3,9 @@ use strict; use warnings; -use Test::More tests => 7; +use Test::More tests => 6; -BEGIN { - use_ok('metaclass'); +BEGIN {use metaclass; } # meta classes diff --git a/t/045_metaclass_loads_classes.t b/t/045_metaclass_loads_classes.t index e6bcc12..e4b85ba 100644 --- a/t/045_metaclass_loads_classes.t +++ b/t/045_metaclass_loads_classes.t @@ -6,11 +6,9 @@ use warnings; use FindBin; use File::Spec::Functions; -use Test::More tests => 9; +use Test::More tests => 8; -BEGIN { - use_ok('Class::MOP'); -} +use Class::MOP; use lib catdir($FindBin::Bin, 'lib'); diff --git a/t/047_rebless_with_extra_params.t b/t/047_rebless_with_extra_params.t index a7842d4..e9bf9bb 100644 --- a/t/047_rebless_with_extra_params.t +++ b/t/047_rebless_with_extra_params.t @@ -3,12 +3,10 @@ use strict; use warnings; -use Test::More tests => 22; +use Test::More tests => 21; use Test::Exception; -BEGIN { - use_ok('Class::MOP'); -} +use Class::MOP; { package Foo; diff --git a/t/060_instance.t b/t/060_instance.t index 108e0a6..75a374e 100644 --- a/t/060_instance.t +++ b/t/060_instance.t @@ -3,14 +3,12 @@ use strict; use warnings; -use Test::More tests => 46; +use Test::More tests => 45; use Test::Exception; use Scalar::Util qw/isweak reftype/; -BEGIN { - use_ok('Class::MOP::Instance'); -} +use Class::MOP::Instance; can_ok( "Class::MOP::Instance", $_ ) for qw/ new diff --git a/t/061_instance_inline.t b/t/061_instance_inline.t index 1679245..9689bba 100644 --- a/t/061_instance_inline.t +++ b/t/061_instance_inline.t @@ -3,12 +3,10 @@ use strict; use warnings; -use Test::More tests => 16; +use Test::More tests => 15; use Test::Exception; -BEGIN { - use_ok('Class::MOP::Instance'); -} +use Class::MOP::Instance; my $C = 'Class::MOP::Instance'; diff --git a/t/070_immutable_metaclass.t b/t/070_immutable_metaclass.t index 6a1c356..cfdb278 100644 --- a/t/070_immutable_metaclass.t +++ b/t/070_immutable_metaclass.t @@ -3,12 +3,10 @@ use strict; use warnings; -use Test::More tests => 85; +use Test::More tests => 84; use Test::Exception; -BEGIN { - use_ok('Class::MOP'); -} +use Class::MOP; { package Foo; diff --git a/t/071_immutable_w_custom_metaclass.t b/t/071_immutable_w_custom_metaclass.t index b93df90..961d71b 100644 --- a/t/071_immutable_w_custom_metaclass.t +++ b/t/071_immutable_w_custom_metaclass.t @@ -6,13 +6,11 @@ use warnings; use FindBin; use File::Spec::Functions; -use Test::More tests => 15; +use Test::More tests => 14; use Test::Exception; use Scalar::Util; -BEGIN { - use_ok('Class::MOP'); -} +use Class::MOP; use lib catdir($FindBin::Bin, 'lib'); diff --git a/t/072_immutable_w_constructors.t b/t/072_immutable_w_constructors.t index cc9c929..5e9c0a1 100644 --- a/t/072_immutable_w_constructors.t +++ b/t/072_immutable_w_constructors.t @@ -3,12 +3,10 @@ use strict; use warnings; -use Test::More tests => 93; +use Test::More tests => 91; use Test::Exception; -BEGIN { - use_ok('Class::MOP'); - use_ok('Class::MOP::Immutable'); +BEGIN {use Class::MOP;use Class::MOP::Immutable; } { diff --git a/t/073_make_mutable.t b/t/073_make_mutable.t index 0fec326..bbf5204 100644 --- a/t/073_make_mutable.t +++ b/t/073_make_mutable.t @@ -3,14 +3,12 @@ use strict; use warnings; -use Test::More tests => 112; +use Test::More tests => 111; use Test::Exception; use Scalar::Util; -BEGIN { - use_ok('Class::MOP'); -} +use Class::MOP; { package Foo; diff --git a/t/081_meta_package_extension.t b/t/081_meta_package_extension.t index d107361..a9503b7 100644 --- a/t/081_meta_package_extension.t +++ b/t/081_meta_package_extension.t @@ -3,11 +3,10 @@ use strict; use warnings; -use Test::More tests => 16; +use Test::More tests => 15; use Test::Exception; -BEGIN { - use_ok('Class::MOP'); +BEGIN {use Class::MOP; } { diff --git a/t/100_BinaryTree_test.t b/t/100_BinaryTree_test.t index 0e84509..f665d4e 100644 --- a/t/100_BinaryTree_test.t +++ b/t/100_BinaryTree_test.t @@ -6,12 +6,10 @@ use warnings; use FindBin; use File::Spec::Functions; -use Test::More tests => 70; +use Test::More tests => 69; use Test::Exception; -BEGIN { - use_ok('Class::MOP'); -} +use Class::MOP; use lib catdir($FindBin::Bin, 'lib'); diff --git a/t/101_InstanceCountingClass_test.t b/t/101_InstanceCountingClass_test.t index 0d422b2..9b7434e 100644 --- a/t/101_InstanceCountingClass_test.t +++ b/t/101_InstanceCountingClass_test.t @@ -3,11 +3,10 @@ use strict; use warnings; -use Test::More tests => 12; +use Test::More tests => 11; use File::Spec; -BEGIN { - use_ok('Class::MOP'); +BEGIN {use Class::MOP; require_ok(File::Spec->catfile('examples', 'InstanceCountingClass.pod')); } diff --git a/t/102_InsideOutClass_test.t b/t/102_InsideOutClass_test.t index e96ef11..d6b80d9 100644 --- a/t/102_InsideOutClass_test.t +++ b/t/102_InsideOutClass_test.t @@ -3,12 +3,11 @@ use strict; use warnings; -use Test::More tests => 89; +use Test::More tests => 88; use File::Spec; use Scalar::Util 'reftype'; -BEGIN { - use_ok('Class::MOP'); +BEGIN {use Class::MOP; require_ok(File::Spec->catfile('examples', 'InsideOutClass.pod')); } diff --git a/t/103_Perl6Attribute_test.t b/t/103_Perl6Attribute_test.t index 3b14e26..630f74a 100644 --- a/t/103_Perl6Attribute_test.t +++ b/t/103_Perl6Attribute_test.t @@ -3,11 +3,10 @@ use strict; use warnings; -use Test::More tests => 10; +use Test::More tests => 9; use File::Spec; -BEGIN { - use_ok('Class::MOP'); +BEGIN {use Class::MOP; require_ok(File::Spec->catfile('examples', 'Perl6Attribute.pod')); } diff --git a/t/104_AttributesWithHistory_test.t b/t/104_AttributesWithHistory_test.t index 741e388..aa6d327 100644 --- a/t/104_AttributesWithHistory_test.t +++ b/t/104_AttributesWithHistory_test.t @@ -3,11 +3,10 @@ use strict; use warnings; -use Test::More tests => 28; +use Test::More tests => 27; use File::Spec; -BEGIN { - use_ok('Class::MOP'); +BEGIN {use Class::MOP; require_ok(File::Spec->catfile('examples', 'AttributesWithHistory.pod')); } diff --git a/t/105_ClassEncapsulatedAttributes_test.t b/t/105_ClassEncapsulatedAttributes_test.t index 0f1047d..9600e6a 100644 --- a/t/105_ClassEncapsulatedAttributes_test.t +++ b/t/105_ClassEncapsulatedAttributes_test.t @@ -3,11 +3,10 @@ use strict; use warnings; -use Test::More tests => 29; +use Test::More tests => 28; use File::Spec; -BEGIN { - use_ok('Class::MOP'); +BEGIN {use Class::MOP; require_ok(File::Spec->catfile('examples', 'ClassEncapsulatedAttributes.pod')); } diff --git a/t/106_LazyClass_test.t b/t/106_LazyClass_test.t index c17b490..5d6d1bf 100644 --- a/t/106_LazyClass_test.t +++ b/t/106_LazyClass_test.t @@ -3,11 +3,10 @@ use strict; use warnings; -use Test::More tests => 26; +use Test::More tests => 25; use File::Spec; -BEGIN { - use_ok('Class::MOP'); +BEGIN {use Class::MOP; require_ok(File::Spec->catfile('examples', 'LazyClass.pod')); } diff --git a/t/107_C3MethodDispatchOrder_test.t b/t/107_C3MethodDispatchOrder_test.t index c00f037..5331463 100644 --- a/t/107_C3MethodDispatchOrder_test.t +++ b/t/107_C3MethodDispatchOrder_test.t @@ -9,9 +9,7 @@ use File::Spec; BEGIN { eval "use Algorithm::C3"; plan skip_all => "Algorithm::C3 required for this test" if $@; - plan tests => 5; - - use_ok('Class::MOP'); + plan tests => 4;use Class::MOP; require_ok(File::Spec->catfile('examples', 'C3MethodDispatchOrder.pod')); } diff --git a/t/108_ArrayBasedStorage_test.t b/t/108_ArrayBasedStorage_test.t index 3e19822..9161f17 100644 --- a/t/108_ArrayBasedStorage_test.t +++ b/t/108_ArrayBasedStorage_test.t @@ -3,12 +3,11 @@ use strict; use warnings; -use Test::More tests => 73; +use Test::More tests => 72; use File::Spec; use Scalar::Util 'reftype'; -BEGIN { - use_ok('Class::MOP'); +BEGIN {use Class::MOP; require_ok(File::Spec->catfile('examples', 'ArrayBasedStorage.pod')); } diff --git a/t/200_Class_C3_compatibility.t b/t/200_Class_C3_compatibility.t index 481b56e..de38c8c 100644 --- a/t/200_Class_C3_compatibility.t +++ b/t/200_Class_C3_compatibility.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More tests => 8; +use Test::More tests => 7; =pod @@ -13,8 +13,7 @@ approach to method resolution. =cut -BEGIN { - use_ok('Class::MOP'); +BEGIN {use Class::MOP; } { diff --git a/t/300_random_eval_bug.t b/t/300_random_eval_bug.t index dc7785b..9d2b19a 100644 --- a/t/300_random_eval_bug.t +++ b/t/300_random_eval_bug.t @@ -3,11 +3,9 @@ use strict; use warnings; -use Test::More tests => 2; +use Test::More tests => 1; -BEGIN { - use_ok('Class::MOP'); -} +use Class::MOP; =pod diff --git a/t/301_RT_27329_fix.t b/t/301_RT_27329_fix.t index ab26542..6943d4c 100644 --- a/t/301_RT_27329_fix.t +++ b/t/301_RT_27329_fix.t @@ -3,11 +3,9 @@ use strict; use warnings; -use Test::More tests => 9; +use Test::More tests => 8; -BEGIN { - use_ok('Class::MOP'); -} +use Class::MOP; =pod diff --git a/t/302_modify_parent_method.t b/t/302_modify_parent_method.t index 958bd30..d28db55 100644 --- a/t/302_modify_parent_method.t +++ b/t/302_modify_parent_method.t @@ -3,12 +3,10 @@ use strict; use warnings; -use Test::More tests => 5; +use Test::More tests => 4; use Test::Exception; -BEGIN { - use_ok('Class::MOP'); -} +use Class::MOP; my @calls; diff --git a/t/303_RT_39001_fix.t b/t/303_RT_39001_fix.t index a185ef2..f301cce 100644 --- a/t/303_RT_39001_fix.t +++ b/t/303_RT_39001_fix.t @@ -2,12 +2,10 @@ use strict; use warnings; -use Test::More tests => 4; +use Test::More tests => 3; use Test::Exception; -BEGIN { - use_ok('Class::MOP'); -} +use Class::MOP; =pod