From: Fuji, Goro Date: Sat, 25 Sep 2010 02:46:44 +0000 (+0900) Subject: s/Moose/Mouse/g more completely X-Git-Tag: 0.72~33 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=854768370fd54135bc90fd39053d9e331c7da2dd;p=gitmo%2FMouse.git s/Moose/Mouse/g more completely --- diff --git a/Moose-t-failing/020_attributes/028_no_slot_access.t b/Moose-t-failing/020_attributes/028_no_slot_access.t index 668f71b..384ef85 100644 --- a/Moose-t-failing/020_attributes/028_no_slot_access.t +++ b/Moose-t-failing/020_attributes/028_no_slot_access.t @@ -15,7 +15,7 @@ use warnings; } { - package MooseX::SomeAwesomeDBFields; + package MouseX::SomeAwesomeDBFields; # implementation of methods not called in the example deliberately # omitted @@ -69,7 +69,7 @@ $TODO = q{Mouse is not yet completed}; Mouse::Util::MetaRole::apply_metaroles( for => __PACKAGE__, - class_metaroles => { instance => ['MooseX::SomeAwesomeDBFields'] }, + class_metaroles => { instance => ['MouseX::SomeAwesomeDBFields'] }, ); lives_ok { diff --git a/Moose-t-failing/040_type_constraints/021_maybe_type_constraint.t b/Moose-t-failing/040_type_constraints/021_maybe_type_constraint.t index 77b05f6..0f0ff3d 100644 --- a/Moose-t-failing/040_type_constraints/021_maybe_type_constraint.t +++ b/Moose-t-failing/040_type_constraints/021_maybe_type_constraint.t @@ -80,7 +80,7 @@ dies_ok { { - package Test::MooseX::Types::Maybe; + package Test::MouseX::Types::Maybe; use Mouse; has 'Maybe_Int' => (is=>'rw', isa=>'Maybe[Int]'); @@ -90,7 +90,7 @@ dies_ok { has 'Maybe_HashRefInt' => (is=>'rw', isa=>'Maybe[HashRef[Int]]'); } -ok my $obj = Test::MooseX::Types::Maybe->new +ok my $obj = Test::MouseX::Types::Maybe->new => 'Create good test object'; ## Maybe[Int] diff --git a/Moose-t-failing/050_metaclasses/014_goto_moose_import.t b/Moose-t-failing/050_metaclasses/014_goto_moose_import.t index 4b5ea9e..e5c8bea 100644 --- a/Moose-t-failing/050_metaclasses/014_goto_moose_import.t +++ b/Moose-t-failing/050_metaclasses/014_goto_moose_import.t @@ -14,7 +14,7 @@ use Test::Exception; # &Mouse::import. we want to make sure it still works. { - package MooseAlike1; + package MouseAlike1; use strict; use warnings; @@ -33,23 +33,23 @@ use Test::Exception; { package Foo; - MooseAlike1->import(); + MouseAlike1->import(); ::lives_ok( sub { has( 'size', is => 'bare' ) }, - 'has was exported via MooseAlike1' ); + 'has was exported via MouseAlike1' ); - MooseAlike1->unimport(); + MouseAlike1->unimport(); } ok( ! Foo->can('has'), - 'No has sub in Foo after MooseAlike1 is unimported' ); + 'No has sub in Foo after MouseAlike1 is unimported' ); ok( Foo->can('meta'), 'Foo has a meta method' ); isa_ok( Foo->meta(), 'Mouse::Meta::Class' ); { - package MooseAlike2; + package MouseAlike2; use strict; use warnings; @@ -70,17 +70,17 @@ isa_ok( Foo->meta(), 'Mouse::Meta::Class' ); { package Bar; - MooseAlike2->import(); + MouseAlike2->import(); ::lives_ok( sub { has( 'size', is => 'bare' ) }, - 'has was exported via MooseAlike2' ); + 'has was exported via MouseAlike2' ); - MooseAlike2->unimport(); + MouseAlike2->unimport(); } ok( ! Bar->can('has'), - 'No has sub in Bar after MooseAlike2 is unimported' ); + 'No has sub in Bar after MouseAlike2 is unimported' ); ok( Bar->can('meta'), 'Bar has a meta method' ); isa_ok( Bar->meta(), 'Mouse::Meta::Class' ); diff --git a/Moose-t-failing/050_metaclasses/015_metarole.t b/Moose-t-failing/050_metaclasses/015_metarole.t index 36e7fd0..527a4ce 100644 --- a/Moose-t-failing/050_metaclasses/015_metarole.t +++ b/Moose-t-failing/050_metaclasses/015_metarole.t @@ -476,7 +476,7 @@ use Mouse::Util::MetaRole; # This tests applying meta roles to a metaclass's metaclass. This is # completely insane, but is exactly what happens with # Fey::Meta::Class::Table. It's a subclass of Mouse::Meta::Class -# itself, and then it _uses_ MooseX::ClassAttribute, so the metaclass +# itself, and then it _uses_ MouseX::ClassAttribute, so the metaclass # for Fey::Meta::Class::Table does a role. # # At one point this caused a metaclass incompatibility error down @@ -565,7 +565,7 @@ use Mouse::Util::MetaRole; } { - package ExportsMoose; + package ExportsMouse; Mouse::Exporter->setup_import_methods( also => 'Mouse', @@ -585,8 +585,8 @@ use Mouse::Util::MetaRole; } lives_ok { - package UsesExportedMoose; - ExportsMoose->import; + package UsesExportedMouse; + ExportsMouse->import; } 'import module which loads a role from disk during init_meta'; { diff --git a/Moose-t-failing/050_metaclasses/023_easy_init_meta.t b/Moose-t-failing/050_metaclasses/023_easy_init_meta.t index ed85866..d16e8df 100644 --- a/Moose-t-failing/050_metaclasses/023_easy_init_meta.t +++ b/Moose-t-failing/050_metaclasses/023_easy_init_meta.t @@ -52,7 +52,7 @@ use Test::Mouse qw(does_ok); } { - package Foo::Exporter::WithMoose; + package Foo::Exporter::WithMouse; use Mouse (); use Mouse::Exporter; @@ -78,7 +78,7 @@ use Test::Mouse qw(does_ok); { package Foo2; - Foo::Exporter::WithMoose->import; + Foo::Exporter::WithMouse->import; has(foo => (is => 'ro')); @@ -98,7 +98,7 @@ use Test::Mouse qw(does_ok); } { - package Foo::Exporter::WithMooseRole; + package Foo::Exporter::WithMouseRole; use Mouse::Role (); use Mouse::Exporter; @@ -123,7 +123,7 @@ use Test::Mouse qw(does_ok); { package Foo2::Role; - Foo::Exporter::WithMooseRole->import; + Foo::Exporter::WithMouseRole->import; ::isa_ok(Foo2::Role->meta, 'Mouse::Meta::Role'); ::does_ok(Foo2::Role->meta, 'Foo::Trait::Class'); diff --git a/Moose-t-failing/050_metaclasses/050_metarole_backcompat.t b/Moose-t-failing/050_metaclasses/050_metarole_backcompat.t index ef06636..c3ce4cf 100644 --- a/Moose-t-failing/050_metaclasses/050_metarole_backcompat.t +++ b/Moose-t-failing/050_metaclasses/050_metarole_backcompat.t @@ -479,7 +479,7 @@ use Mouse::Util::MetaRole; # This tests applying meta roles to a metaclass's metaclass. This is # completely insane, but is exactly what happens with # Fey::Meta::Class::Table. It's a subclass of Mouse::Meta::Class -# itself, and then it _uses_ MooseX::ClassAttribute, so the metaclass +# itself, and then it _uses_ MouseX::ClassAttribute, so the metaclass # for Fey::Meta::Class::Table does a role. # # At one point this caused a metaclass incompatibility error down @@ -568,7 +568,7 @@ use Mouse::Util::MetaRole; } { - package ExportsMoose; + package ExportsMouse; Mouse::Exporter->setup_import_methods( also => 'Mouse', @@ -588,8 +588,8 @@ use Mouse::Util::MetaRole; } lives_ok { - package UsesExportedMoose; - ExportsMoose->import; + package UsesExportedMouse; + ExportsMouse->import; } 'import module which loads a role from disk during init_meta'; { diff --git a/Moose-t-failing/200_examples/006_example_Protomoose.t b/Moose-t-failing/200_examples/006_example_Protomoose.t index e33167c..1cf4939 100644 --- a/Moose-t-failing/200_examples/006_example_Protomoose.t +++ b/Moose-t-failing/200_examples/006_example_Protomoose.t @@ -24,7 +24,7 @@ Well cause merlyn asked if it could :) ## make some metaclasses { - package ProtoMoose::Meta::Instance; + package ProtoMouse::Meta::Instance; use Mouse; BEGIN { extends 'Mouse::Meta::Instance' }; @@ -36,7 +36,7 @@ Well cause merlyn asked if it could :) } { - package ProtoMoose::Meta::Method::Accessor; + package ProtoMouse::Meta::Method::Accessor; use Mouse; BEGIN { extends 'Mouse::Meta::Method' }; @@ -112,16 +112,16 @@ Well cause merlyn asked if it could :) } { - package ProtoMoose::Meta::Attribute; + package ProtoMouse::Meta::Attribute; use Mouse; BEGIN { extends 'Mouse::Meta::Attribute' }; - sub accessor_metaclass { 'ProtoMoose::Meta::Method::Accessor' } + sub accessor_metaclass { 'ProtoMouse::Meta::Method::Accessor' } } { - package ProtoMoose::Meta::Class; + package ProtoMouse::Meta::Class; use Mouse; BEGIN { extends 'Mouse::Meta::Class' }; @@ -140,8 +140,8 @@ Well cause merlyn asked if it could :) # not work here, have to investigate # it later - SL (shift)->SUPER::initialize(@_, - instance_metaclass => 'ProtoMoose::Meta::Instance', - attribute_metaclass => 'ProtoMoose::Meta::Attribute', + instance_metaclass => 'ProtoMouse::Meta::Instance', + attribute_metaclass => 'ProtoMouse::Meta::Attribute', ); } @@ -161,8 +161,8 @@ Well cause merlyn asked if it could :) } { - package ProtoMoose::Object; - use metaclass 'ProtoMoose::Meta::Class'; + package ProtoMouse::Object; + use metaclass 'ProtoMouse::Meta::Class'; use Mouse; sub new { @@ -183,7 +183,7 @@ Well cause merlyn asked if it could :) package Foo; use Mouse; - extends 'ProtoMoose::Object'; + extends 'ProtoMouse::Object'; has 'bar' => (is => 'rw'); } @@ -202,17 +202,17 @@ Well cause merlyn asked if it could :) ## ------------------------------------------------------------------ ## Check that metaclasses are working/inheriting properly -foreach my $class (qw/ProtoMoose::Object Foo Bar/) { +foreach my $class (qw/ProtoMouse::Object Foo Bar/) { isa_ok($class->meta, - 'ProtoMoose::Meta::Class', + 'ProtoMouse::Meta::Class', '... got the right metaclass for ' . $class . ' ->'); is($class->meta->instance_metaclass, - 'ProtoMoose::Meta::Instance', + 'ProtoMouse::Meta::Instance', '... got the right instance meta for ' . $class); is($class->meta->attribute_metaclass, - 'ProtoMoose::Meta::Attribute', + 'ProtoMouse::Meta::Attribute', '... got the right attribute meta for ' . $class); } diff --git a/author/import-moose-test.pl b/author/import-moose-test.pl index fcb6db8..e897359 100644 --- a/author/import-moose-test.pl +++ b/author/import-moose-test.pl @@ -4,6 +4,7 @@ use strict; use warnings FATAL => 'all'; use File::Path qw(mkpath); use File::Find; +use File::Basename qw(basename dirname); use autodie; my($moose_dir, $result) = @ARGV; @@ -15,15 +16,18 @@ $result //= 'Moose-t'; my @tests; sub wanted { return if /native_traits/; - (my $mouse_test = $_) =~ s{\A $moose_dir/t }{$result}xmso; - (my $mouse_failing_test = $_) =~ s{\A $moose_dir/t }{$result-failing}xmso; + my $file = $_; + (my $basename = basename($file)) =~ s/Moose/Mouse/g; + $file = dirname($file) . '/' . $basename; + (my $test = $file) =~ s{\A $moose_dir/t }{$result}xmso; + (my $failing_test = $file) =~ s{\A $moose_dir/t }{$result-failing}xmso; if( -d $_ ) { - mkpath [$mouse_test, $mouse_failing_test]; + mkpath [$test, $failing_test]; return; } - copy_as_mouse($_ => $mouse_test); - push @tests, [$mouse_test, $mouse_failing_test] - if $mouse_test =~/\.t\z/xms; + copy_as_mouse($_ => $test); + push @tests, [$test, $failing_test] + if $file =~/\.t\z/xms; return; } @@ -77,9 +81,9 @@ sub copy_as_mouse { say $out "# DO NOT EDIT THIS FILE. ANY CHANGES WILL BE LOST!!!"; say $out 'use t::lib::MooseCompat;'; } - s/\b Class::MOP::([a-z_]+) \b/Mouse::Util::$1/xmsg; - s/\b Class::MOP \b /Mouse::Meta/xmsg; - s/\b Moose \b/Mouse/xmsg; + s/ Class::MOP::([a-z_]+) /Mouse::Util::$1/xmsg; + s/ Class::MOP /Mouse::Meta/xmsg; + s/ Moose /Mouse/xmsg; # make classes simple s{\b(Mouse::Meta::TypeConstraint)::\w+ }{$1}xmsg;