Fix bug from RT#46459, misc cleanups in Catalyst::Test
Tomas Doran [Sun, 28 Jun 2009 23:45:59 +0000 (23:45 +0000)]
Changes
lib/Catalyst/Test.pm

diff --git a/Changes b/Changes
index 00222a2..e4b3bea 100644 (file)
--- a/Changes
+++ b/Changes
@@ -3,13 +3,17 @@
   Bug fixes:
         - Revert change to URL encode things passed into $c->uri_for
           Args and CaptureArgs as this causes breakage to pre-existing
-          applications.
+          applications (t0m).
         - Remove use of Test::MockObject as it doesn't install from CPAN
-          in some environments.
+          in some environments (t0m).
         - Remove use of dclone to deep copy configs and replace with
           Catalyst::Utils::merge_hashes which has the same effect, of
           ensuring child classes don't inherit their parent's config,
-          except works correctly with closures.
+          except works correctly with closures (t0m).
+        - Add Class::C3::reinitialize into Catalyst::Test to avoid weird
+          bugs in ctx_request (bokutin in RT#46459)
+        - Fix issues with _parse_PathPrefix_attr method in Catalyst::Controller
+          (jasonk in RT#42816)
 
   New features:
         - Use ~ as prefix for plugins or action classes which are located in
@@ -20,7 +24,7 @@
           references, that close over the context, without creating leaks
           (Florian Ragwitz).
 
-  Things t0m needs to move into an actual changelog section, after he introduced that shit:
+   Refactoring / cleanups:
         - Clean namespaces in Catalyst::Exception* (Florian Ragwitz).
         - Turn Catalyst::Exception into an actual class and make the throw
           method create instances of it. They can still be used as normal
@@ -29,6 +33,9 @@
         - Add a rethrow method to Catalyst::Exception (Florian Ragwitz).
         - Add Catalyst::Exception::Detach and ::Go, and refactor detach() and
           go() to use them instead of magic, global strings (Florian Ragwitz).
+          Fixes RT#47366
+        - Clean up getting metaclass instance and making app class immutable
+          again in Catalyst::Test (t0m)
 
 5.80005 2009-06-06 14:40:00
 
index 10d16ca..75821bf 100644 (file)
@@ -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 = $class->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();
         ### 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->( @_ );