X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FTest.pm;h=3b319ed2b23d1e518d65af94244acea349906dfe;hb=fe7c695472757ce438df8ac82e6e7626bcc41f3c;hp=f18029ac394cc94bbd53d461e07615fad8dcecf9;hpb=0eb98177aa8e4ff96f8e3165585b083ae7ae16ee;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/Test.pm b/lib/Catalyst/Test.pm index f18029a..3b319ed 100644 --- a/lib/Catalyst/Test.pm +++ b/lib/Catalyst/Test.pm @@ -31,7 +31,7 @@ my $build_exports = sub { my $get = sub { $request->(@_)->content }; my $ctx_request = sub { - my $me = ref $self || $self; + my $me = ref $self || $self; ### throw an exception if ctx_request is being used against a remote ### server @@ -49,13 +49,13 @@ my $build_exports = sub { ### hook into 'dispatch' -- the function gets called after all plugins ### have done their work, and it's an easy place to capture $c. - my $meta = Catalyst->meta; + my $meta = Class::MOP::get_metaclass_by_name($class); $meta->make_mutable; $meta->add_after_method_modifier( "dispatch", sub { $c = shift; }); - $meta->make_immutable; - + $meta->make_immutable( replace_constructor => 1 ); + Class::C3::reinitialize(); # Fixes RT#46459, I've failed to write a test for how/why, but it does. ### do the request; C::T::request will know about the class name, and ### we've already stopped it from doing remote requests above. my $res = $request->( @_ ); @@ -339,7 +339,7 @@ Catalyst Contributors, see Catalyst.pm =head1 COPYRIGHT -This program is free software, you can redistribute it and/or modify it under +This library is free software. You can redistribute it and/or modify it under the same terms as Perl itself. =cut