[Catalyst-commits] r11434 - in
Catalyst-Runtime/5.80/branches/aggregate_more/t: . aggregate
rafl at dev.catalyst.perl.org
rafl at dev.catalyst.perl.org
Sun Sep 27 15:06:51 GMT 2009
Author: rafl
Date: 2009-09-27 15:06:51 +0000 (Sun, 27 Sep 2009)
New Revision: 11434
Added:
Catalyst-Runtime/5.80/branches/aggregate_more/t/aggregate/c3_appclass_bug.t
Catalyst-Runtime/5.80/branches/aggregate_more/t/aggregate/c3_mro.t
Catalyst-Runtime/5.80/branches/aggregate_more/t/aggregate/caf_backcompat.t
Catalyst-Runtime/5.80/branches/aggregate_more/t/aggregate/custom_live_component_controller_action_auto_doublebug.t
Catalyst-Runtime/5.80/branches/aggregate_more/t/aggregate/custom_live_path_bug.t
Catalyst-Runtime/5.80/branches/aggregate_more/t/aggregate/meta_method_unneeded.t
Catalyst-Runtime/5.80/branches/aggregate_more/t/aggregate/unit_load_catalyst_test.t
Catalyst-Runtime/5.80/branches/aggregate_more/t/aggregate/unit_metaclass_compat_extend_non_moose_controller.t
Catalyst-Runtime/5.80/branches/aggregate_more/t/aggregate/unit_metaclass_compat_non_moose.t
Catalyst-Runtime/5.80/branches/aggregate_more/t/aggregate/unit_metaclass_compat_non_moose_controller.t
Removed:
Catalyst-Runtime/5.80/branches/aggregate_more/t/c3_appclass_bug.t
Catalyst-Runtime/5.80/branches/aggregate_more/t/c3_mro.t
Catalyst-Runtime/5.80/branches/aggregate_more/t/caf_backcompat.t
Catalyst-Runtime/5.80/branches/aggregate_more/t/custom_live_component_controller_action_auto_doublebug.t
Catalyst-Runtime/5.80/branches/aggregate_more/t/custom_live_path_bug.t
Catalyst-Runtime/5.80/branches/aggregate_more/t/meta_method_unneeded.t
Catalyst-Runtime/5.80/branches/aggregate_more/t/unit_load_catalyst_test.t
Catalyst-Runtime/5.80/branches/aggregate_more/t/unit_metaclass_compat_extend_non_moose_controller.t
Catalyst-Runtime/5.80/branches/aggregate_more/t/unit_metaclass_compat_non_moose.t
Catalyst-Runtime/5.80/branches/aggregate_more/t/unit_metaclass_compat_non_moose_controller.t
Log:
More aggregation.
Copied: Catalyst-Runtime/5.80/branches/aggregate_more/t/aggregate/c3_appclass_bug.t (from rev 11433, Catalyst-Runtime/5.80/branches/aggregate_more/t/c3_appclass_bug.t)
===================================================================
--- Catalyst-Runtime/5.80/branches/aggregate_more/t/aggregate/c3_appclass_bug.t (rev 0)
+++ Catalyst-Runtime/5.80/branches/aggregate_more/t/aggregate/c3_appclass_bug.t 2009-09-27 15:06:51 UTC (rev 11434)
@@ -0,0 +1,30 @@
+use strict;
+use Test::More tests => 1;
+
+{
+ package TestPlugin;
+ use strict;
+
+ sub setup {
+ shift->maybe::next::method(@_);
+ }
+}
+{
+ package TestAppC3ErrorUseMoose;
+ use Moose;
+
+ use Catalyst::Runtime 5.80;
+
+ use base qw/Catalyst/;
+ use Catalyst qw/
+ +TestPlugin
+ /;
+}
+
+use Test::Exception;
+lives_ok {
+ TestAppC3ErrorUseMoose->setup();
+} 'No C3 error';
+
+1;
+
Copied: Catalyst-Runtime/5.80/branches/aggregate_more/t/aggregate/c3_mro.t (from rev 11433, Catalyst-Runtime/5.80/branches/aggregate_more/t/c3_mro.t)
===================================================================
--- Catalyst-Runtime/5.80/branches/aggregate_more/t/aggregate/c3_mro.t (rev 0)
+++ Catalyst-Runtime/5.80/branches/aggregate_more/t/aggregate/c3_mro.t 2009-09-27 15:06:51 UTC (rev 11434)
@@ -0,0 +1,38 @@
+use strict;
+use warnings;
+
+use Test::More;
+require Catalyst;
+require Module::Pluggable::Object;
+use MRO::Compat;
+
+# Get a list of all Catalyst:: packages in blib via M::P::O
+my @cat_mods;
+{
+ # problem with @INC on win32, see:
+ # http://rt.cpan.org/Ticket/Display.html?id=26452
+ if ($^O eq 'MSWin32') { require Win32; Win32::GetCwd(); }
+
+ local @INC = grep {/blib/} @INC;
+ @cat_mods = (
+ 'Catalyst',
+ Module::Pluggable::Object->new(search_path => ['Catalyst'])->plugins,
+ );
+}
+
+# plan one test per found package name
+plan tests => scalar @cat_mods;
+
+# Try to calculate the C3 MRO for each package
+#
+# In the case that the initial require fails (as in
+# Catalyst::Engine::FastCGI when FCGI is not installed),
+# the calculateMRO eval will not error out, which is
+# effectively a test skip.
+#
+foreach my $cat_mod (@cat_mods) {
+ eval " require $cat_mod ";
+ eval { mro::get_linear_isa($cat_mod, 'c3') };
+ ok(!$@, "calculateMRO for $cat_mod: $@");
+}
+
Copied: Catalyst-Runtime/5.80/branches/aggregate_more/t/aggregate/caf_backcompat.t (from rev 11433, Catalyst-Runtime/5.80/branches/aggregate_more/t/caf_backcompat.t)
===================================================================
--- Catalyst-Runtime/5.80/branches/aggregate_more/t/aggregate/caf_backcompat.t (rev 0)
+++ Catalyst-Runtime/5.80/branches/aggregate_more/t/aggregate/caf_backcompat.t 2009-09-27 15:06:51 UTC (rev 11434)
@@ -0,0 +1,28 @@
+use strict;
+use warnings;
+use Test::More;
+use Test::Exception;
+use Class::MOP ();
+use Moose::Util ();
+
+# List of everything which used Class::Accessor::Fast in 5.70.
+my @modules = qw/
+ Catalyst::Action
+ Catalyst::ActionContainer
+ Catalyst::Component
+ Catalyst::Dispatcher
+ Catalyst::DispatchType
+ Catalyst::Engine
+ Catalyst::Log
+ Catalyst::Request::Upload
+ Catalyst::Request
+ Catalyst::Response
+/;
+
+plan tests => scalar @modules;
+
+foreach my $module (@modules) {
+ Class::MOP::load_class($module);
+ ok Moose::Util::does_role($module => 'MooseX::Emulate::Class::Accessor::Fast'),
+ "$module has Class::Accessor::Fast back-compat";
+}
Copied: Catalyst-Runtime/5.80/branches/aggregate_more/t/aggregate/custom_live_component_controller_action_auto_doublebug.t (from rev 11433, Catalyst-Runtime/5.80/branches/aggregate_more/t/custom_live_component_controller_action_auto_doublebug.t)
===================================================================
--- Catalyst-Runtime/5.80/branches/aggregate_more/t/aggregate/custom_live_component_controller_action_auto_doublebug.t (rev 0)
+++ Catalyst-Runtime/5.80/branches/aggregate_more/t/aggregate/custom_live_component_controller_action_auto_doublebug.t 2009-09-27 15:06:51 UTC (rev 11434)
@@ -0,0 +1,48 @@
+#!perl
+
+use strict;
+use warnings;
+
+use FindBin;
+use lib "$FindBin::Bin/lib";
+
+our $iters;
+
+BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 1; }
+
+use Test::More tests => 3*$iters;
+use Catalyst::Test 'TestAppDoubleAutoBug';
+
+if ( $ENV{CAT_BENCHMARK} ) {
+ require Benchmark;
+ Benchmark::timethis( $iters, \&run_tests );
+}
+else {
+ for ( 1 .. $iters ) {
+ run_tests();
+ }
+}
+
+sub run_tests {
+ SKIP:
+ {
+ if ( $ENV{CATALYST_SERVER} ) {
+ skip 'Using remote server', 3;
+ }
+
+ {
+ my @expected = qw[
+ TestAppDoubleAutoBug::Controller::Root->auto
+ TestAppDoubleAutoBug::Controller::Root->default
+ TestAppDoubleAutoBug::Controller::Root->end
+ ];
+
+ my $expected = join( ", ", @expected );
+
+ ok( my $response = request('http://localhost/action/auto/one'), 'auto + local' );
+ is( $response->header('X-Catalyst-Executed'),
+ $expected, 'Executed actions' );
+ is( $response->content, 'default, auto=1', 'Content OK' );
+ }
+ }
+}
Copied: Catalyst-Runtime/5.80/branches/aggregate_more/t/aggregate/custom_live_path_bug.t (from rev 11433, Catalyst-Runtime/5.80/branches/aggregate_more/t/custom_live_path_bug.t)
===================================================================
--- Catalyst-Runtime/5.80/branches/aggregate_more/t/aggregate/custom_live_path_bug.t (rev 0)
+++ Catalyst-Runtime/5.80/branches/aggregate_more/t/aggregate/custom_live_path_bug.t 2009-09-27 15:06:51 UTC (rev 11434)
@@ -0,0 +1,39 @@
+#!perl
+
+use strict;
+use warnings;
+
+use FindBin;
+use lib "$FindBin::Bin/lib";
+
+our $iters;
+
+BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 1; }
+
+use Test::More tests => 2*$iters;
+use Catalyst::Test 'TestAppPathBug';
+
+if ( $ENV{CAT_BENCHMARK} ) {
+ require Benchmark;
+ Benchmark::timethis( $iters, \&run_tests );
+}
+else {
+ for ( 1 .. $iters ) {
+ run_tests();
+ }
+}
+
+sub run_tests {
+ SKIP:
+ {
+ if ( $ENV{CATALYST_SERVER} ) {
+ skip 'Using remote server', 2;
+ }
+
+ {
+ my $expected = 'This is the foo method.';
+ ok( my $response = request('http://localhost/'), 'response ok' );
+ is( $response->content, $expected, 'Content OK' );
+ }
+ }
+}
Copied: Catalyst-Runtime/5.80/branches/aggregate_more/t/aggregate/meta_method_unneeded.t (from rev 11433, Catalyst-Runtime/5.80/branches/aggregate_more/t/meta_method_unneeded.t)
===================================================================
--- Catalyst-Runtime/5.80/branches/aggregate_more/t/aggregate/meta_method_unneeded.t (rev 0)
+++ Catalyst-Runtime/5.80/branches/aggregate_more/t/aggregate/meta_method_unneeded.t 2009-09-27 15:06:51 UTC (rev 11434)
@@ -0,0 +1,20 @@
+use strict;
+use warnings;
+use FindBin qw/$Bin/;
+use lib "$Bin/lib";
+use Test::More tests => 1;
+use Test::Exception;
+use Carp ();
+
+# Doing various silly things, like for example
+# use CGI qw/:standard/ in your conrtoller / app
+# will overwrite your meta method, therefore Catalyst
+# can't depend on it being there correctly.
+
+# This is/was demonstrated by Catalyst::Controller::WrapCGI
+# and Catalyst::Plugin::Cache::Curried
+
+use Catalyst::Test 'TestAppWithMeta';
+
+ok( request('/')->is_success );
+
Copied: Catalyst-Runtime/5.80/branches/aggregate_more/t/aggregate/unit_load_catalyst_test.t (from rev 11433, Catalyst-Runtime/5.80/branches/aggregate_more/t/unit_load_catalyst_test.t)
===================================================================
--- Catalyst-Runtime/5.80/branches/aggregate_more/t/aggregate/unit_load_catalyst_test.t (rev 0)
+++ Catalyst-Runtime/5.80/branches/aggregate_more/t/aggregate/unit_load_catalyst_test.t 2009-09-27 15:06:51 UTC (rev 11434)
@@ -0,0 +1,154 @@
+#!perl
+
+use strict;
+use warnings;
+
+use FindBin;
+use lib "$FindBin::Bin/lib";
+use Test::More tests => 59;
+use FindBin qw/$Bin/;
+use lib "$Bin/lib";
+use Catalyst::Utils;
+use HTTP::Request::Common;
+use Test::Exception;
+
+my $Class = 'Catalyst::Test';
+my $App = 'TestApp';
+my $Pkg = __PACKAGE__;
+my $Url = 'http://localhost/';
+my $Content = "root index";
+
+my %Meth = (
+ $Pkg => [qw|get request ctx_request|], # exported
+ $Class => [qw|local_request remote_request|], # not exported
+);
+
+### make sure we're not trying to connect to a remote host -- these are local tests
+local $ENV{CATALYST_SERVER};
+
+use_ok( $Class );
+
+### check available methods
+{ ### turn of redefine warnings, we'll get new subs exported
+ ### XXX 'no warnings' and 'local $^W' wont work as warnings are turned on in
+ ### test.pm, so trap them for now --kane
+ { local $SIG{__WARN__} = sub {};
+ ok( $Class->import, "Argumentless import for methods only" );
+ }
+
+ while( my($class, $meths) = each %Meth ) {
+ for my $meth ( @$meths ) { SKIP: {
+
+ ### method available?
+ can_ok( $class, $meth );
+
+ ### only for exported methods
+ skip "Error tests only for exported methods", 2 unless $class eq $Pkg;
+
+ ### check error conditions
+ eval { $class->can($meth)->( $Url ) };
+ ok( $@, " $meth without app gives error" );
+ like( $@, qr/$Class/,
+ " Error filled with expected content for '$meth'" );
+ } }
+ }
+}
+
+### simple tests for exported methods
+{ ### turn of redefine warnings, we'll get new subs exported
+ ### XXX 'no warnings' and 'local $^W' wont work as warnings are turned on in
+ ### test.pm, so trap them for now --kane
+ { local $SIG{__WARN__} = sub {};
+ ok( $Class->import( $App ),
+ "Loading $Class for App $App" );
+ }
+
+ ### test exported methods again
+ for my $meth ( @{ $Meth{$Pkg} } ) { SKIP: {
+
+ ### do a call, we should get a result and perhaps a $c if it's 'ctx_request';
+ my ($res, $c) = eval { $Pkg->can($meth)->( $Url ) };
+
+ ok( 1, " Called $Pkg->$meth( $Url )" );
+ ok( !$@, " No critical error $@" );
+ ok( $res, " Result obtained" );
+
+ ### get the content as a string, to make sure we got what we expected
+ my $res_as_string = $meth eq 'get' ? $res : $res->content;
+ is( $res_as_string, $Content,
+ " Content as expected: $res_as_string" );
+
+ ### some tests for 'ctx_request'
+ skip "Context tests skipped for '$meth'", 6 unless $meth eq 'ctx_request';
+
+ ok( $c, " Context object returned" );
+ isa_ok( $c, $App, " Object" );
+ is( $c->request->uri, $Url,
+ " Url recorded in request" );
+ is( $c->response->body, $Content,
+ " Content recorded in response" );
+ ok( $c->stash, " Stash accessible" );
+ ok( $c->action, " Action object accessible" );
+ } }
+}
+
+### perl5.8.8 + cat 5.80's Cat::Test->ctx_request didn't return $c the 2nd
+### time it was invoked. Without tracking the bug down all the way, it was
+### clearly related to the Moose'ification of Cat::Test and a scoping issue
+### with a 'my'd variable. Since the same code works fine in 5.10, a bug in
+### either Moose or perl 5.8 is suspected.
+{ ok( 1, "Testing consistency of ctx_request()" );
+ for( 1..2 ) {
+ my($res, $c) = ctx_request( $Url );
+ ok( $c, " Call $_: Context object returned" );
+ }
+}
+
+# FIXME - These vhosts in tests tests should be somewhere else...
+
+sub customize { Catalyst::Test::_customize_request(@_) }
+
+{
+ my $req = Catalyst::Utils::request('/dummy');
+ customize( $req );
+ is( $req->header('Host'), undef, 'normal request is unmodified' );
+}
+
+{
+ my $req = Catalyst::Utils::request('/dummy');
+ customize( $req, { host => 'customized.com' } );
+ like( $req->header('Host'), qr/customized.com/, 'request is customizable via opts hash' );
+}
+
+{
+ my $req = Catalyst::Utils::request('/dummy');
+ local $Catalyst::Test::default_host = 'localized.com';
+ customize( $req );
+ like( $req->header('Host'), qr/localized.com/, 'request is customizable via package var' );
+}
+
+{
+ my $req = Catalyst::Utils::request('/dummy');
+ local $Catalyst::Test::default_host = 'localized.com';
+ customize( $req, { host => 'customized.com' } );
+ like( $req->header('Host'), qr/customized.com/, 'opts hash takes precedence over package var' );
+}
+
+{
+ my $req = Catalyst::Utils::request('/dummy');
+ local $Catalyst::Test::default_host = 'localized.com';
+ customize( $req, { host => '' } );
+ is( $req->header('Host'), undef, 'default value can be temporarily cleared via opts hash' );
+}
+
+# Back compat test, extra args used to be ignored, now a hashref of options.
+use_ok('Catalyst::Test', 'TestApp', 'foobar');
+
+# Back compat test, ensure that request ignores anything which isn't a hash.
+lives_ok {
+ request(GET('/dummy'), 'foo');
+} 'scalar additional param to request method ignored';
+lives_ok {
+ request(GET('/dummy'), []);
+} 'array additional param to request method ignored';
+
Copied: Catalyst-Runtime/5.80/branches/aggregate_more/t/aggregate/unit_metaclass_compat_extend_non_moose_controller.t (from rev 11433, Catalyst-Runtime/5.80/branches/aggregate_more/t/unit_metaclass_compat_extend_non_moose_controller.t)
===================================================================
--- Catalyst-Runtime/5.80/branches/aggregate_more/t/aggregate/unit_metaclass_compat_extend_non_moose_controller.t (rev 0)
+++ Catalyst-Runtime/5.80/branches/aggregate_more/t/aggregate/unit_metaclass_compat_extend_non_moose_controller.t 2009-09-27 15:06:51 UTC (rev 11434)
@@ -0,0 +1,20 @@
+use Catalyst ();
+
+{
+ package TestApp;
+ use base qw/Catalyst/;
+}
+{
+ package TestApp::Controller::Base;
+ use base qw/Catalyst::Controller/;
+}
+{
+ package TestApp::Controller::Other;
+ use Moose;
+ use Test::More tests => 1;
+ use Test::Exception;
+ lives_ok {
+ extends 'TestApp::Controller::Base';
+ };
+}
+
Copied: Catalyst-Runtime/5.80/branches/aggregate_more/t/aggregate/unit_metaclass_compat_non_moose.t (from rev 11433, Catalyst-Runtime/5.80/branches/aggregate_more/t/unit_metaclass_compat_non_moose.t)
===================================================================
--- Catalyst-Runtime/5.80/branches/aggregate_more/t/aggregate/unit_metaclass_compat_non_moose.t (rev 0)
+++ Catalyst-Runtime/5.80/branches/aggregate_more/t/aggregate/unit_metaclass_compat_non_moose.t 2009-09-27 15:06:51 UTC (rev 11434)
@@ -0,0 +1,7 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use lib 't/lib';
+use Test::More tests => 1;
+use_ok('TestAppMetaCompat');
+
Copied: Catalyst-Runtime/5.80/branches/aggregate_more/t/aggregate/unit_metaclass_compat_non_moose_controller.t (from rev 11433, Catalyst-Runtime/5.80/branches/aggregate_more/t/unit_metaclass_compat_non_moose_controller.t)
===================================================================
--- Catalyst-Runtime/5.80/branches/aggregate_more/t/aggregate/unit_metaclass_compat_non_moose_controller.t (rev 0)
+++ Catalyst-Runtime/5.80/branches/aggregate_more/t/aggregate/unit_metaclass_compat_non_moose_controller.t 2009-09-27 15:06:51 UTC (rev 11434)
@@ -0,0 +1,19 @@
+use strict;
+use warnings;
+
+use FindBin;
+use lib "$FindBin::Bin/lib";
+
+use Test::More tests => 1;
+use Test::Exception;
+use TestAppNonMooseController;
+
+# Metaclass init order causes fail.
+# There are TODO tests in Moose for this, see
+# f2391d17574eff81d911b97be15ea51080500003
+# after which the evil kludge in core can die in a fire.
+
+lives_ok {
+ TestAppNonMooseController::ControllerBase->get_action_methods
+} 'Base class->get_action_methods ok when sub class initialized first';
+
Deleted: Catalyst-Runtime/5.80/branches/aggregate_more/t/c3_appclass_bug.t
===================================================================
--- Catalyst-Runtime/5.80/branches/aggregate_more/t/c3_appclass_bug.t 2009-09-27 15:06:36 UTC (rev 11433)
+++ Catalyst-Runtime/5.80/branches/aggregate_more/t/c3_appclass_bug.t 2009-09-27 15:06:51 UTC (rev 11434)
@@ -1,30 +0,0 @@
-use strict;
-use Test::More tests => 1;
-
-{
- package TestPlugin;
- use strict;
-
- sub setup {
- shift->maybe::next::method(@_);
- }
-}
-{
- package TestAppC3ErrorUseMoose;
- use Moose;
-
- use Catalyst::Runtime 5.80;
-
- use base qw/Catalyst/;
- use Catalyst qw/
- +TestPlugin
- /;
-}
-
-use Test::Exception;
-lives_ok {
- TestAppC3ErrorUseMoose->setup();
-} 'No C3 error';
-
-1;
-
Deleted: Catalyst-Runtime/5.80/branches/aggregate_more/t/c3_mro.t
===================================================================
--- Catalyst-Runtime/5.80/branches/aggregate_more/t/c3_mro.t 2009-09-27 15:06:36 UTC (rev 11433)
+++ Catalyst-Runtime/5.80/branches/aggregate_more/t/c3_mro.t 2009-09-27 15:06:51 UTC (rev 11434)
@@ -1,38 +0,0 @@
-use strict;
-use warnings;
-
-use Test::More;
-require Catalyst;
-require Module::Pluggable::Object;
-use MRO::Compat;
-
-# Get a list of all Catalyst:: packages in blib via M::P::O
-my @cat_mods;
-{
- # problem with @INC on win32, see:
- # http://rt.cpan.org/Ticket/Display.html?id=26452
- if ($^O eq 'MSWin32') { require Win32; Win32::GetCwd(); }
-
- local @INC = grep {/blib/} @INC;
- @cat_mods = (
- 'Catalyst',
- Module::Pluggable::Object->new(search_path => ['Catalyst'])->plugins,
- );
-}
-
-# plan one test per found package name
-plan tests => scalar @cat_mods;
-
-# Try to calculate the C3 MRO for each package
-#
-# In the case that the initial require fails (as in
-# Catalyst::Engine::FastCGI when FCGI is not installed),
-# the calculateMRO eval will not error out, which is
-# effectively a test skip.
-#
-foreach my $cat_mod (@cat_mods) {
- eval " require $cat_mod ";
- eval { mro::get_linear_isa($cat_mod, 'c3') };
- ok(!$@, "calculateMRO for $cat_mod: $@");
-}
-
Deleted: Catalyst-Runtime/5.80/branches/aggregate_more/t/caf_backcompat.t
===================================================================
--- Catalyst-Runtime/5.80/branches/aggregate_more/t/caf_backcompat.t 2009-09-27 15:06:36 UTC (rev 11433)
+++ Catalyst-Runtime/5.80/branches/aggregate_more/t/caf_backcompat.t 2009-09-27 15:06:51 UTC (rev 11434)
@@ -1,28 +0,0 @@
-use strict;
-use warnings;
-use Test::More;
-use Test::Exception;
-use Class::MOP ();
-use Moose::Util ();
-
-# List of everything which used Class::Accessor::Fast in 5.70.
-my @modules = qw/
- Catalyst::Action
- Catalyst::ActionContainer
- Catalyst::Component
- Catalyst::Dispatcher
- Catalyst::DispatchType
- Catalyst::Engine
- Catalyst::Log
- Catalyst::Request::Upload
- Catalyst::Request
- Catalyst::Response
-/;
-
-plan tests => scalar @modules;
-
-foreach my $module (@modules) {
- Class::MOP::load_class($module);
- ok Moose::Util::does_role($module => 'MooseX::Emulate::Class::Accessor::Fast'),
- "$module has Class::Accessor::Fast back-compat";
-}
Deleted: Catalyst-Runtime/5.80/branches/aggregate_more/t/custom_live_component_controller_action_auto_doublebug.t
===================================================================
--- Catalyst-Runtime/5.80/branches/aggregate_more/t/custom_live_component_controller_action_auto_doublebug.t 2009-09-27 15:06:36 UTC (rev 11433)
+++ Catalyst-Runtime/5.80/branches/aggregate_more/t/custom_live_component_controller_action_auto_doublebug.t 2009-09-27 15:06:51 UTC (rev 11434)
@@ -1,48 +0,0 @@
-#!perl
-
-use strict;
-use warnings;
-
-use FindBin;
-use lib "$FindBin::Bin/lib";
-
-our $iters;
-
-BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 1; }
-
-use Test::More tests => 3*$iters;
-use Catalyst::Test 'TestAppDoubleAutoBug';
-
-if ( $ENV{CAT_BENCHMARK} ) {
- require Benchmark;
- Benchmark::timethis( $iters, \&run_tests );
-}
-else {
- for ( 1 .. $iters ) {
- run_tests();
- }
-}
-
-sub run_tests {
- SKIP:
- {
- if ( $ENV{CATALYST_SERVER} ) {
- skip 'Using remote server', 3;
- }
-
- {
- my @expected = qw[
- TestAppDoubleAutoBug::Controller::Root->auto
- TestAppDoubleAutoBug::Controller::Root->default
- TestAppDoubleAutoBug::Controller::Root->end
- ];
-
- my $expected = join( ", ", @expected );
-
- ok( my $response = request('http://localhost/action/auto/one'), 'auto + local' );
- is( $response->header('X-Catalyst-Executed'),
- $expected, 'Executed actions' );
- is( $response->content, 'default, auto=1', 'Content OK' );
- }
- }
-}
Deleted: Catalyst-Runtime/5.80/branches/aggregate_more/t/custom_live_path_bug.t
===================================================================
--- Catalyst-Runtime/5.80/branches/aggregate_more/t/custom_live_path_bug.t 2009-09-27 15:06:36 UTC (rev 11433)
+++ Catalyst-Runtime/5.80/branches/aggregate_more/t/custom_live_path_bug.t 2009-09-27 15:06:51 UTC (rev 11434)
@@ -1,39 +0,0 @@
-#!perl
-
-use strict;
-use warnings;
-
-use FindBin;
-use lib "$FindBin::Bin/lib";
-
-our $iters;
-
-BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 1; }
-
-use Test::More tests => 2*$iters;
-use Catalyst::Test 'TestAppPathBug';
-
-if ( $ENV{CAT_BENCHMARK} ) {
- require Benchmark;
- Benchmark::timethis( $iters, \&run_tests );
-}
-else {
- for ( 1 .. $iters ) {
- run_tests();
- }
-}
-
-sub run_tests {
- SKIP:
- {
- if ( $ENV{CATALYST_SERVER} ) {
- skip 'Using remote server', 2;
- }
-
- {
- my $expected = 'This is the foo method.';
- ok( my $response = request('http://localhost/'), 'response ok' );
- is( $response->content, $expected, 'Content OK' );
- }
- }
-}
Deleted: Catalyst-Runtime/5.80/branches/aggregate_more/t/meta_method_unneeded.t
===================================================================
--- Catalyst-Runtime/5.80/branches/aggregate_more/t/meta_method_unneeded.t 2009-09-27 15:06:36 UTC (rev 11433)
+++ Catalyst-Runtime/5.80/branches/aggregate_more/t/meta_method_unneeded.t 2009-09-27 15:06:51 UTC (rev 11434)
@@ -1,20 +0,0 @@
-use strict;
-use warnings;
-use FindBin qw/$Bin/;
-use lib "$Bin/lib";
-use Test::More tests => 1;
-use Test::Exception;
-use Carp ();
-
-# Doing various silly things, like for example
-# use CGI qw/:standard/ in your conrtoller / app
-# will overwrite your meta method, therefore Catalyst
-# can't depend on it being there correctly.
-
-# This is/was demonstrated by Catalyst::Controller::WrapCGI
-# and Catalyst::Plugin::Cache::Curried
-
-use Catalyst::Test 'TestAppWithMeta';
-
-ok( request('/')->is_success );
-
Deleted: Catalyst-Runtime/5.80/branches/aggregate_more/t/unit_load_catalyst_test.t
===================================================================
--- Catalyst-Runtime/5.80/branches/aggregate_more/t/unit_load_catalyst_test.t 2009-09-27 15:06:36 UTC (rev 11433)
+++ Catalyst-Runtime/5.80/branches/aggregate_more/t/unit_load_catalyst_test.t 2009-09-27 15:06:51 UTC (rev 11434)
@@ -1,154 +0,0 @@
-#!perl
-
-use strict;
-use warnings;
-
-use FindBin;
-use lib "$FindBin::Bin/lib";
-use Test::More tests => 59;
-use FindBin qw/$Bin/;
-use lib "$Bin/lib";
-use Catalyst::Utils;
-use HTTP::Request::Common;
-use Test::Exception;
-
-my $Class = 'Catalyst::Test';
-my $App = 'TestApp';
-my $Pkg = __PACKAGE__;
-my $Url = 'http://localhost/';
-my $Content = "root index";
-
-my %Meth = (
- $Pkg => [qw|get request ctx_request|], # exported
- $Class => [qw|local_request remote_request|], # not exported
-);
-
-### make sure we're not trying to connect to a remote host -- these are local tests
-local $ENV{CATALYST_SERVER};
-
-use_ok( $Class );
-
-### check available methods
-{ ### turn of redefine warnings, we'll get new subs exported
- ### XXX 'no warnings' and 'local $^W' wont work as warnings are turned on in
- ### test.pm, so trap them for now --kane
- { local $SIG{__WARN__} = sub {};
- ok( $Class->import, "Argumentless import for methods only" );
- }
-
- while( my($class, $meths) = each %Meth ) {
- for my $meth ( @$meths ) { SKIP: {
-
- ### method available?
- can_ok( $class, $meth );
-
- ### only for exported methods
- skip "Error tests only for exported methods", 2 unless $class eq $Pkg;
-
- ### check error conditions
- eval { $class->can($meth)->( $Url ) };
- ok( $@, " $meth without app gives error" );
- like( $@, qr/$Class/,
- " Error filled with expected content for '$meth'" );
- } }
- }
-}
-
-### simple tests for exported methods
-{ ### turn of redefine warnings, we'll get new subs exported
- ### XXX 'no warnings' and 'local $^W' wont work as warnings are turned on in
- ### test.pm, so trap them for now --kane
- { local $SIG{__WARN__} = sub {};
- ok( $Class->import( $App ),
- "Loading $Class for App $App" );
- }
-
- ### test exported methods again
- for my $meth ( @{ $Meth{$Pkg} } ) { SKIP: {
-
- ### do a call, we should get a result and perhaps a $c if it's 'ctx_request';
- my ($res, $c) = eval { $Pkg->can($meth)->( $Url ) };
-
- ok( 1, " Called $Pkg->$meth( $Url )" );
- ok( !$@, " No critical error $@" );
- ok( $res, " Result obtained" );
-
- ### get the content as a string, to make sure we got what we expected
- my $res_as_string = $meth eq 'get' ? $res : $res->content;
- is( $res_as_string, $Content,
- " Content as expected: $res_as_string" );
-
- ### some tests for 'ctx_request'
- skip "Context tests skipped for '$meth'", 6 unless $meth eq 'ctx_request';
-
- ok( $c, " Context object returned" );
- isa_ok( $c, $App, " Object" );
- is( $c->request->uri, $Url,
- " Url recorded in request" );
- is( $c->response->body, $Content,
- " Content recorded in response" );
- ok( $c->stash, " Stash accessible" );
- ok( $c->action, " Action object accessible" );
- } }
-}
-
-### perl5.8.8 + cat 5.80's Cat::Test->ctx_request didn't return $c the 2nd
-### time it was invoked. Without tracking the bug down all the way, it was
-### clearly related to the Moose'ification of Cat::Test and a scoping issue
-### with a 'my'd variable. Since the same code works fine in 5.10, a bug in
-### either Moose or perl 5.8 is suspected.
-{ ok( 1, "Testing consistency of ctx_request()" );
- for( 1..2 ) {
- my($res, $c) = ctx_request( $Url );
- ok( $c, " Call $_: Context object returned" );
- }
-}
-
-# FIXME - These vhosts in tests tests should be somewhere else...
-
-sub customize { Catalyst::Test::_customize_request(@_) }
-
-{
- my $req = Catalyst::Utils::request('/dummy');
- customize( $req );
- is( $req->header('Host'), undef, 'normal request is unmodified' );
-}
-
-{
- my $req = Catalyst::Utils::request('/dummy');
- customize( $req, { host => 'customized.com' } );
- like( $req->header('Host'), qr/customized.com/, 'request is customizable via opts hash' );
-}
-
-{
- my $req = Catalyst::Utils::request('/dummy');
- local $Catalyst::Test::default_host = 'localized.com';
- customize( $req );
- like( $req->header('Host'), qr/localized.com/, 'request is customizable via package var' );
-}
-
-{
- my $req = Catalyst::Utils::request('/dummy');
- local $Catalyst::Test::default_host = 'localized.com';
- customize( $req, { host => 'customized.com' } );
- like( $req->header('Host'), qr/customized.com/, 'opts hash takes precedence over package var' );
-}
-
-{
- my $req = Catalyst::Utils::request('/dummy');
- local $Catalyst::Test::default_host = 'localized.com';
- customize( $req, { host => '' } );
- is( $req->header('Host'), undef, 'default value can be temporarily cleared via opts hash' );
-}
-
-# Back compat test, extra args used to be ignored, now a hashref of options.
-use_ok('Catalyst::Test', 'TestApp', 'foobar');
-
-# Back compat test, ensure that request ignores anything which isn't a hash.
-lives_ok {
- request(GET('/dummy'), 'foo');
-} 'scalar additional param to request method ignored';
-lives_ok {
- request(GET('/dummy'), []);
-} 'array additional param to request method ignored';
-
Deleted: Catalyst-Runtime/5.80/branches/aggregate_more/t/unit_metaclass_compat_extend_non_moose_controller.t
===================================================================
--- Catalyst-Runtime/5.80/branches/aggregate_more/t/unit_metaclass_compat_extend_non_moose_controller.t 2009-09-27 15:06:36 UTC (rev 11433)
+++ Catalyst-Runtime/5.80/branches/aggregate_more/t/unit_metaclass_compat_extend_non_moose_controller.t 2009-09-27 15:06:51 UTC (rev 11434)
@@ -1,20 +0,0 @@
-use Catalyst ();
-
-{
- package TestApp;
- use base qw/Catalyst/;
-}
-{
- package TestApp::Controller::Base;
- use base qw/Catalyst::Controller/;
-}
-{
- package TestApp::Controller::Other;
- use Moose;
- use Test::More tests => 1;
- use Test::Exception;
- lives_ok {
- extends 'TestApp::Controller::Base';
- };
-}
-
Deleted: Catalyst-Runtime/5.80/branches/aggregate_more/t/unit_metaclass_compat_non_moose.t
===================================================================
--- Catalyst-Runtime/5.80/branches/aggregate_more/t/unit_metaclass_compat_non_moose.t 2009-09-27 15:06:36 UTC (rev 11433)
+++ Catalyst-Runtime/5.80/branches/aggregate_more/t/unit_metaclass_compat_non_moose.t 2009-09-27 15:06:51 UTC (rev 11434)
@@ -1,7 +0,0 @@
-#!/usr/bin/env perl
-use strict;
-use warnings;
-use lib 't/lib';
-use Test::More tests => 1;
-use_ok('TestAppMetaCompat');
-
Deleted: Catalyst-Runtime/5.80/branches/aggregate_more/t/unit_metaclass_compat_non_moose_controller.t
===================================================================
--- Catalyst-Runtime/5.80/branches/aggregate_more/t/unit_metaclass_compat_non_moose_controller.t 2009-09-27 15:06:36 UTC (rev 11433)
+++ Catalyst-Runtime/5.80/branches/aggregate_more/t/unit_metaclass_compat_non_moose_controller.t 2009-09-27 15:06:51 UTC (rev 11434)
@@ -1,19 +0,0 @@
-use strict;
-use warnings;
-
-use FindBin;
-use lib "$FindBin::Bin/lib";
-
-use Test::More tests => 1;
-use Test::Exception;
-use TestAppNonMooseController;
-
-# Metaclass init order causes fail.
-# There are TODO tests in Moose for this, see
-# f2391d17574eff81d911b97be15ea51080500003
-# after which the evil kludge in core can die in a fire.
-
-lives_ok {
- TestAppNonMooseController::ControllerBase->get_action_methods
-} 'Base class->get_action_methods ok when sub class initialized first';
-
More information about the Catalyst-commits
mailing list