r63076 - in /trunk/libcatalyst-perl: ./ debian/ lib/ lib/Catalyst/ lib/Catalyst/Script/ t/ t/aggregate/ t/author/ t/lib/ t/lib/ChainedActionsApp/ t/lib/TestApp/Controller/ t/lib/TestAppShowInternalActions/
jawnsy-guest at users.alioth.debian.org
jawnsy-guest at users.alioth.debian.org
Wed Sep 29 01:14:21 UTC 2010
Author: jawnsy-guest
Date: Wed Sep 29 01:14:02 2010
New Revision: 63076
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=63076
Log:
New upstream release
Added:
trunk/libcatalyst-perl/t/aggregate/live__component_controller_action_chained2.t
- copied unchanged from r63075, branches/upstream/libcatalyst-perl/current/t/aggregate/live__component_controller_action_chained2.t
trunk/libcatalyst-perl/t/lib/ChainedActionsApp/
- copied from r63075, branches/upstream/libcatalyst-perl/current/t/lib/ChainedActionsApp/
trunk/libcatalyst-perl/t/lib/ChainedActionsApp.pm
- copied unchanged from r63075, branches/upstream/libcatalyst-perl/current/t/lib/ChainedActionsApp.pm
trunk/libcatalyst-perl/t/lib/TestAppShowInternalActions/
- copied from r63075, branches/upstream/libcatalyst-perl/current/t/lib/TestAppShowInternalActions/
trunk/libcatalyst-perl/t/lib/TestAppShowInternalActions.pm
- copied unchanged from r63075, branches/upstream/libcatalyst-perl/current/t/lib/TestAppShowInternalActions.pm
trunk/libcatalyst-perl/t/live_show_internal_actions_warnings.t
- copied unchanged from r63075, branches/upstream/libcatalyst-perl/current/t/live_show_internal_actions_warnings.t
Modified:
trunk/libcatalyst-perl/Changes
trunk/libcatalyst-perl/MANIFEST
trunk/libcatalyst-perl/META.yml
trunk/libcatalyst-perl/Makefile.PL
trunk/libcatalyst-perl/debian/changelog
trunk/libcatalyst-perl/lib/Catalyst.pm
trunk/libcatalyst-perl/lib/Catalyst/Runtime.pm
trunk/libcatalyst-perl/lib/Catalyst/Script/CGI.pm
trunk/libcatalyst-perl/lib/Catalyst/Script/Server.pm
trunk/libcatalyst-perl/lib/Catalyst/ScriptRole.pm
trunk/libcatalyst-perl/lib/Catalyst/Test.pm
trunk/libcatalyst-perl/lib/Catalyst/Utils.pm
trunk/libcatalyst-perl/t/aggregate/live_engine_response_headers.t
trunk/libcatalyst-perl/t/aggregate/unit_core_script_help.t
trunk/libcatalyst-perl/t/aggregate/unit_core_script_test.t
trunk/libcatalyst-perl/t/author/podcoverage.t
trunk/libcatalyst-perl/t/custom_exception_class_simple.t
trunk/libcatalyst-perl/t/lib/TestApp/Controller/Root.pm
trunk/libcatalyst-perl/t/lib/TestAppClassExceptionSimpleTest.pm
trunk/libcatalyst-perl/t/live_catalyst_test.t
trunk/libcatalyst-perl/t/optional_http-server-restart.t
trunk/libcatalyst-perl/t/optional_threads.t
trunk/libcatalyst-perl/t/unit_core_methodattributes_method_metaclass_on_subclasses.t
Modified: trunk/libcatalyst-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcatalyst-perl/Changes?rev=63076&op=diff
==============================================================================
--- trunk/libcatalyst-perl/Changes (original)
+++ trunk/libcatalyst-perl/Changes Wed Sep 29 01:14:02 2010
@@ -1,4 +1,54 @@
# This file documents the revision history for Perl extension Catalyst.
+
+5.80028 2010-09-28 20:49:00
+
+ Bug fixes:
+ - use Class::MOP in Catalyst::Utils.
+
+ - Do not keep a reference to a closed over context in ctx_request, allowing
+ the caller to dispose of the request context at their leisure.
+
+ - Changes to be compatible with bleadperl
+
+5.80027 2010-09-01 22:14:00
+
+ Bug fixes:
+ - Fix an issue with newly added test cases which depended on Catalyst::Action::RenderView
+
+5.80026 2010-09-01 15:14:00
+
+ Bug fixes:
+ - Fix so that CATALYST_EXCEPTION_CLASS in MyApp is always respected by
+ not loading Catalyst::Exception in Utils.pm BEGIN, because some Scripts::*
+ load Utils before MyApp.pm
+
+ - Fix warnings with new Moose versions about "excludes" during role
+ application
+
+ - Fix warning from MooseX::Getopt regarding duplicate "help" aliases.
+
+ - parse_on_demand fixed when used in conjunction with debug mode.
+ A regression was introduced in 5.80022 which would cause the body
+ to always be parsed for logging at the end of the request when in
+ debug mode. This has been fixed so that if the body has not been parsed
+ by the time the request is logged, then the body is omitted.
+
+ - Fix show_internal_actions config setting producing warnings in debug
+ mode (RT#59738)
+
+ - Make Catalyst::Test::local_request() set the response base from base href
+ in the returned document so that links can be resolved correctly by
+ Test::WWW::Mechanize::Catalyst
+
+ Refactoring:
+ - moved component name sort that happens in setup_components to
+ locate_components to allow methods to wrap around locate_components
+
+ Documentation:
+ - Fix some typos
+
+ - Advertise Catalyst::Plugin::SmartURI
+
5.80025 2010-07-29 01:50:00
@@ -14,6 +64,8 @@
- Fix controllers with no method attributes (where the action definitions
are entirely contained in config). RT#58057
- Fix running as a CGI under IIS at non-root locations.
+ - Fix warning about "excludes" during role application
+ - Fix warning from MooseX::Getopt regarding duplicate "help" aliases
Documentation:
- Fix missing - in the docs when describing the --mechanize option at one
Modified: trunk/libcatalyst-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcatalyst-perl/MANIFEST?rev=63076&op=diff
==============================================================================
--- trunk/libcatalyst-perl/MANIFEST (original)
+++ trunk/libcatalyst-perl/MANIFEST Wed Sep 29 01:14:02 2010
@@ -74,6 +74,7 @@
t/aggregate/custom_live_path_bug.t
t/aggregate/deprecated_test_import.t
t/aggregate/error_page_dump.t
+t/aggregate/live__component_controller_action_chained2.t
t/aggregate/live_component_controller_action_action.t
t/aggregate/live_component_controller_action_auto.t
t/aggregate/live_component_controller_action_begin.t
@@ -196,6 +197,8 @@
t/lib/Catalyst/Script/Baz.pm
t/lib/Catalyst/Script/CompileTest.pm
t/lib/CDICompatTestPlugin.pm
+t/lib/ChainedActionsApp.pm
+t/lib/ChainedActionsApp/Controller/Root.pm
t/lib/DeprecatedActionsInAppClassTestApp.pm
t/lib/DeprecatedTestApp.pm
t/lib/DeprecatedTestApp/C/Root.pm
@@ -325,6 +328,8 @@
t/lib/TestAppPathBug.pm
t/lib/TestAppPluginWithConstructor.pm
t/lib/TestAppPluginWithConstructor/Controller/Root.pm
+t/lib/TestAppShowInternalActions.pm
+t/lib/TestAppShowInternalActions/Controller/Root.pm
t/lib/TestAppStats.pm
t/lib/TestAppStats/Controller/Root.pm
t/lib/TestAppToTestScripts.pm
@@ -335,6 +340,7 @@
t/live_catalyst_test.t
t/live_component_controller_context_closure.t
t/live_fork.t
+t/live_show_internal_actions_warnings.t
t/live_stats.t
t/optional_apache-cgi-rewrite.pl
t/optional_apache-cgi.pl
Modified: trunk/libcatalyst-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcatalyst-perl/META.yml?rev=63076&op=diff
==============================================================================
--- trunk/libcatalyst-perl/META.yml (original)
+++ trunk/libcatalyst-perl/META.yml Wed Sep 29 01:14:02 2010
@@ -30,6 +30,7 @@
Data::Dump: 0
Data::OptList: 0
HTML::Entities: 0
+ HTML::HeadParser: 0
HTTP::Body: 1.06
HTTP::Headers: 1.64
HTTP::Request: 5.814
@@ -41,7 +42,7 @@
Module::Pluggable: 3.9
Moose: 1.03
MooseX::Emulate::Class::Accessor::Fast: 0.00903
- MooseX::Getopt: 0.25
+ MooseX::Getopt: 0.30
MooseX::MethodAttributes::Inheritable: 0.19
MooseX::Role::WithOverloading: 0.05
MooseX::Types: 0
@@ -68,4 +69,4 @@
homepage: http://dev.catalyst.perl.org/
license: http://dev.perl.org/licenses/
repository: http://dev.catalyst.perl.org/repos/Catalyst/Catalyst-Runtime/
-version: 5.80025
+version: 5.80028
Modified: trunk/libcatalyst-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcatalyst-perl/Makefile.PL?rev=63076&op=diff
==============================================================================
--- trunk/libcatalyst-perl/Makefile.PL (original)
+++ trunk/libcatalyst-perl/Makefile.PL Wed Sep 29 01:14:02 2010
@@ -28,6 +28,7 @@
requires 'Data::Dump';
requires 'Data::OptList';
requires 'HTML::Entities';
+requires 'HTML::HeadParser';
requires 'HTTP::Body' => '1.06'; # ->cleanup(1)
requires 'HTTP::Headers' => '1.64';
requires 'HTTP::Request' => '5.814';
@@ -46,7 +47,7 @@
requires 'Task::Weaken';
requires 'Text::Balanced'; # core in 5.8.x but mentioned for completeness
requires 'MRO::Compat';
-requires 'MooseX::Getopt' => '0.25';
+requires 'MooseX::Getopt' => '0.30';
requires 'MooseX::Types';
requires 'MooseX::Types::Common::Numeric';
requires 'String::RewritePrefix' => '0.004'; # Catalyst::Utils::resolve_namespace
@@ -65,7 +66,7 @@
grep { $_ ne 't/aggregate.t' }
map { glob } qw[t/*.t t/aggregate/*.t];
}
-author_requires 'CatalystX::LeakChecker', '0.05'; # Skipped if this isn't installed
+author_requires 'CatalystX::LeakChecker', '0.05';
author_requires 'File::Copy::Recursive'; # For http server test
author_tests 't/author';
Modified: trunk/libcatalyst-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcatalyst-perl/debian/changelog?rev=63076&op=diff
==============================================================================
--- trunk/libcatalyst-perl/debian/changelog (original)
+++ trunk/libcatalyst-perl/debian/changelog Wed Sep 29 01:14:02 2010
@@ -1,3 +1,9 @@
+libcatalyst-perl (5.80028-1) UNRELEASED; urgency=low
+
+ * New upstream release
+
+ -- Jonathan Yu <jawnsy at cpan.org> Tue, 28 Sep 2010 21:23:13 -0400
+
libcatalyst-perl (5.80025-1) unstable; urgency=low
* New upstream release.
Modified: trunk/libcatalyst-perl/lib/Catalyst.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcatalyst-perl/lib/Catalyst.pm?rev=63076&op=diff
==============================================================================
--- trunk/libcatalyst-perl/lib/Catalyst.pm (original)
+++ trunk/libcatalyst-perl/lib/Catalyst.pm Wed Sep 29 01:14:02 2010
@@ -79,7 +79,7 @@
# Remember to update this in Catalyst::Runtime as well!
-our $VERSION = '5.80025';
+our $VERSION = '5.80028';
sub import {
my ( $class, @arguments ) = @_;
@@ -427,6 +427,10 @@
with localized C<< $c->action >> and C<< $c->namespace >>. Like C<detach>,
C<go> escapes the processing of the current request chain on completion, and
does not return to its caller.
+
+ at arguments are arguments to the final destination of $action. @captures are
+arguments to the intermediate steps, if any, on the way to the final sub of
+$action.
=cut
@@ -1242,7 +1246,9 @@
Constructs an absolute L<URI> object based on the application root, the
provided path, and the additional arguments and query parameters provided.
-When used as a string, provides a textual URI.
+When used as a string, provides a textual URI. If you need more flexibility
+than this (i.e. the option to provide relative URIs etc.) see
+L<Catalyst::Plugin::SmartURI>.
If no arguments are provided, the URI for the current action is returned.
To return the current action and also provide @args, use
@@ -1699,7 +1705,7 @@
my $parent = $c->stack->[-1];
# forward, locate the caller
- if ( exists $c->counter->{"$parent"} ) {
+ if ( defined $parent && exists $c->counter->{"$parent"} ) {
$c->stats->profile(
begin => $action,
parent => "$parent" . $c->counter->{"$parent"},
@@ -2148,7 +2154,7 @@
$c->log->debug("Query keywords are: $keywords");
}
- $c->log_request_parameters( query => $request->query_parameters, body => $request->body_parameters );
+ $c->log_request_parameters( query => $request->query_parameters, $request->_has_body ? (body => $request->body_parameters) : () );
$c->log_request_uploads($request);
}
@@ -2405,8 +2411,7 @@
my $config = $class->config->{ setup_components };
- my @comps = sort { length $a <=> length $b }
- $class->locate_components($config);
+ my @comps = $class->locate_components($config);
my %comps = map { $_ => 1 } @comps;
my $deprecatedcatalyst_component_names = grep { /::[CMV]::/ } @comps;
@@ -2461,7 +2466,8 @@
%$config
);
- my @comps = $locator->plugins;
+ # XXX think about ditching this sort entirely
+ my @comps = sort { length $a <=> length $b } $locator->plugins;
return @comps;
}
Modified: trunk/libcatalyst-perl/lib/Catalyst/Runtime.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcatalyst-perl/lib/Catalyst/Runtime.pm?rev=63076&op=diff
==============================================================================
--- trunk/libcatalyst-perl/lib/Catalyst/Runtime.pm (original)
+++ trunk/libcatalyst-perl/lib/Catalyst/Runtime.pm Wed Sep 29 01:14:02 2010
@@ -7,7 +7,7 @@
# Remember to update this in Catalyst as well!
-our $VERSION = '5.80025';
+our $VERSION = '5.80028';
=head1 NAME
Modified: trunk/libcatalyst-perl/lib/Catalyst/Script/CGI.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcatalyst-perl/lib/Catalyst/Script/CGI.pm?rev=63076&op=diff
==============================================================================
--- trunk/libcatalyst-perl/lib/Catalyst/Script/CGI.pm (original)
+++ trunk/libcatalyst-perl/lib/Catalyst/Script/CGI.pm Wed Sep 29 01:14:02 2010
@@ -16,7 +16,7 @@
myapp_cgi.pl [options]
Options:
- -h --help display this help and exits
+ -? --help display this help and exits
=head1 DESCRIPTION
Modified: trunk/libcatalyst-perl/lib/Catalyst/Script/Server.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcatalyst-perl/lib/Catalyst/Script/Server.pm?rev=63076&op=diff
==============================================================================
--- trunk/libcatalyst-perl/lib/Catalyst/Script/Server.pm (original)
+++ trunk/libcatalyst-perl/lib/Catalyst/Script/Server.pm Wed Sep 29 01:14:02 2010
@@ -12,8 +12,6 @@
use namespace::autoclean;
with 'Catalyst::ScriptRole';
-
-__PACKAGE__->meta->get_attribute('help')->cmd_aliases('?');
has debug => (
traits => [qw(Getopt)],
Modified: trunk/libcatalyst-perl/lib/Catalyst/ScriptRole.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcatalyst-perl/lib/Catalyst/ScriptRole.pm?rev=63076&op=diff
==============================================================================
--- trunk/libcatalyst-perl/lib/Catalyst/ScriptRole.pm (original)
+++ trunk/libcatalyst-perl/lib/Catalyst/ScriptRole.pm Wed Sep 29 01:14:02 2010
@@ -6,7 +6,7 @@
use namespace::autoclean;
with 'MooseX::Getopt' => {
- excludes => [qw/
+ -excludes => [qw/
_getopt_spec_warnings
_getopt_spec_exception
_getopt_full_usage
@@ -18,14 +18,6 @@
isa => Str,
is => 'ro',
required => 1,
-);
-
-has help => (
- traits => ['Getopt'],
- isa => Bool,
- is => 'ro',
- documentation => 'Display this help and exit',
- cmd_aliases => ['?', 'h'],
);
sub _getopt_spec_exception {}
@@ -40,11 +32,6 @@
pod2usage();
exit 0;
}
-
-before run => sub {
- my $self = shift;
- $self->_getopt_full_usage if $self->help;
-};
sub run {
my $self = shift;
Modified: trunk/libcatalyst-perl/lib/Catalyst/Test.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcatalyst-perl/lib/Catalyst/Test.pm?rev=63076&op=diff
==============================================================================
--- trunk/libcatalyst-perl/lib/Catalyst/Test.pm (original)
+++ trunk/libcatalyst-perl/lib/Catalyst/Test.pm Wed Sep 29 01:14:02 2010
@@ -44,7 +44,7 @@
### place holder for $c after the request finishes; reset every time
### requests are done.
- my $c;
+ my $ctx_closed_over;
### hook into 'dispatch' -- the function gets called after all plugins
### have done their work, and it's an easy place to capture $c.
@@ -52,7 +52,7 @@
my $meta = Class::MOP::get_metaclass_by_name($class);
$meta->make_mutable;
$meta->add_after_method_modifier( "dispatch", sub {
- $c = shift;
+ $ctx_closed_over = shift;
});
$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.
@@ -60,8 +60,18 @@
### we've already stopped it from doing remote requests above.
my $res = $request->( @_ );
+ # Make sure not to leave a reference $ctx hanging around.
+ # This means that the context will go out of scope as soon as the
+ # caller disposes of it, rather than waiting till the next time
+ # that ctx_request is called. This can be important if your $ctx
+ # ends up with a reference to a shared resource or lock (for example)
+ # which you want to clean up in test teardown - if the $ctx is still
+ # closed over then you're stuffed...
+ my $ctx = $ctx_closed_over;
+ undef $ctx_closed_over;
+
### return both values
- return ( $res, $c );
+ return ( $res, $ctx );
};
return {
@@ -239,6 +249,21 @@
my $response = $cgi->restore->response;
$response->request( $request );
+
+ # HTML head parsing based on LWP::UserAgent
+
+ require HTML::HeadParser;
+
+ my $parser = HTML::HeadParser->new();
+ $parser->xml_mode(1) if $response->content_is_xhtml;
+ $parser->utf8_mode(1) if $] >= 5.008 && $HTML::Parser::VERSION >= 3.40;
+
+ $parser->parse( $response->content );
+ my $h = $parser->header;
+ for my $f ( $h->header_field_names ) {
+ $response->init_header( $f, [ $h->header($f) ] );
+ }
+
return $response;
}
Modified: trunk/libcatalyst-perl/lib/Catalyst/Utils.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcatalyst-perl/lib/Catalyst/Utils.pm?rev=63076&op=diff
==============================================================================
--- trunk/libcatalyst-perl/lib/Catalyst/Utils.pm (original)
+++ trunk/libcatalyst-perl/lib/Catalyst/Utils.pm Wed Sep 29 01:14:02 2010
@@ -1,14 +1,13 @@
package Catalyst::Utils;
use strict;
-use Catalyst::Exception;
use File::Spec;
use HTTP::Request;
use Path::Class;
use URI;
use Carp qw/croak/;
use Cwd;
-
+use Class::MOP;
use String::RewritePrefix;
use namespace::clean;
@@ -140,6 +139,13 @@
eval { $tmpdir->mkpath };
if ($@) {
+ # don't load Catalyst::Exception as a BEGIN in Utils,
+ # because Utils often gets loaded before MyApp.pm, and if
+ # Catalyst::Exception is loaded before MyApp.pm, it does
+ # not honor setting
+ # $Catalyst::Exception::CATALYST_EXCEPTION_CLASS in
+ # MyApp.pm
+ require Catalyst::Exception;
Catalyst::Exception->throw(
message => qq/Couldn't create tmpdir '$tmpdir', "$@"/ );
}
Modified: trunk/libcatalyst-perl/t/aggregate/live_engine_response_headers.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcatalyst-perl/t/aggregate/live_engine_response_headers.t?rev=63076&op=diff
==============================================================================
--- trunk/libcatalyst-perl/t/aggregate/live_engine_response_headers.t (original)
+++ trunk/libcatalyst-perl/t/aggregate/live_engine_response_headers.t Wed Sep 29 01:14:02 2010
@@ -12,7 +12,7 @@
my $content_length;
-foreach my $method qw(HEAD GET) {
+foreach my $method (qw(HEAD GET)) {
my $expected = join( ', ', 1 .. 10 );
my $request = HTTP::Request::Common->can($method)
Modified: trunk/libcatalyst-perl/t/aggregate/unit_core_script_help.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcatalyst-perl/t/aggregate/unit_core_script_help.t?rev=63076&op=diff
==============================================================================
--- trunk/libcatalyst-perl/t/aggregate/unit_core_script_help.t (original)
+++ trunk/libcatalyst-perl/t/aggregate/unit_core_script_help.t Wed Sep 29 01:14:02 2010
@@ -15,7 +15,6 @@
sub _getopt_full_usage { $help++ }
}
-test('-h');
test('--help');
test('-?');
Modified: trunk/libcatalyst-perl/t/aggregate/unit_core_script_test.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcatalyst-perl/t/aggregate/unit_core_script_test.t?rev=63076&op=diff
==============================================================================
--- trunk/libcatalyst-perl/t/aggregate/unit_core_script_test.t (original)
+++ trunk/libcatalyst-perl/t/aggregate/unit_core_script_test.t Wed Sep 29 01:14:02 2010
@@ -33,8 +33,8 @@
} "new_with_options";
ok $i;
my $saved;
- open( $saved, '<&'. STDIN->fileno )
- or croak("Can't dup stdin: $!");
+ open( $saved, '>&'. STDOUT->fileno )
+ or croak("Can't dup stdout: $!");
open( STDOUT, '>&='. $fh->fileno )
or croak("Can't open stdout: $!");
eval { $i->run };
Modified: trunk/libcatalyst-perl/t/author/podcoverage.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcatalyst-perl/t/author/podcoverage.t?rev=63076&op=diff
==============================================================================
--- trunk/libcatalyst-perl/t/author/podcoverage.t (original)
+++ trunk/libcatalyst-perl/t/author/podcoverage.t Wed Sep 29 01:14:02 2010
@@ -5,9 +5,12 @@
use Pod::Coverage 0.19;
use Test::Pod::Coverage 1.04;
-all_pod_coverage_ok(
- {
- also_private => ['BUILD']
- }
-);
+my @modules = all_modules;
+our @private = ( 'BUILD' );
+foreach my $module (@modules) {
+ local @private = (@private, 'run') if $module =~ /^Catalyst::Script::/;
+ pod_coverage_ok($module, { also_private => \@private });
+}
+done_testing;
+
Modified: trunk/libcatalyst-perl/t/custom_exception_class_simple.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcatalyst-perl/t/custom_exception_class_simple.t?rev=63076&op=diff
==============================================================================
--- trunk/libcatalyst-perl/t/custom_exception_class_simple.t (original)
+++ trunk/libcatalyst-perl/t/custom_exception_class_simple.t Wed Sep 29 01:14:02 2010
@@ -4,9 +4,17 @@
use warnings;
use FindBin qw/$Bin/;
use lib "$Bin/lib";
-use Test::More tests => 1;
+use Test::More tests => 2;
use Test::Exception;
lives_ok {
require TestAppClassExceptionSimpleTest;
} 'Can load application';
+
+
+lives_ok {
+ Catalyst::Exception->throw
+} 'throw is properly stubbed out';
+
+
+
Modified: trunk/libcatalyst-perl/t/lib/TestApp/Controller/Root.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcatalyst-perl/t/lib/TestApp/Controller/Root.pm?rev=63076&op=diff
==============================================================================
--- trunk/libcatalyst-perl/t/lib/TestApp/Controller/Root.pm (original)
+++ trunk/libcatalyst-perl/t/lib/TestApp/Controller/Root.pm Wed Sep 29 01:14:02 2010
@@ -49,6 +49,22 @@
$c->forward( 'recursion_test' );
}
+sub base_href_test : Local {
+ my ( $self, $c ) = @_;
+
+ my $body = <<"EndOfBody";
+<html>
+ <head>
+ <base href="http://www.example.com/">
+ </head>
+ <body>
+ </body>
+</html>
+EndOfBody
+
+ $c->response->body($body);
+}
+
sub end : Private {
my ($self,$c) = @_;
}
Modified: trunk/libcatalyst-perl/t/lib/TestAppClassExceptionSimpleTest.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcatalyst-perl/t/lib/TestAppClassExceptionSimpleTest.pm?rev=63076&op=diff
==============================================================================
--- trunk/libcatalyst-perl/t/lib/TestAppClassExceptionSimpleTest.pm (original)
+++ trunk/libcatalyst-perl/t/lib/TestAppClassExceptionSimpleTest.pm Wed Sep 29 01:14:02 2010
@@ -10,6 +10,8 @@
use strict;
use warnings;
+use Catalyst::Utils; #< some of the scripts use Catalyst::Utils before MyApp.pm
+
BEGIN { $Catalyst::Exception::CATALYST_EXCEPTION_CLASS = 'TestAppClassExceptionSimpleTest::Exception'; }
use Catalyst;
Modified: trunk/libcatalyst-perl/t/live_catalyst_test.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcatalyst-perl/t/live_catalyst_test.t?rev=63076&op=diff
==============================================================================
--- trunk/libcatalyst-perl/t/live_catalyst_test.t (original)
+++ trunk/libcatalyst-perl/t/live_catalyst_test.t Wed Sep 29 01:14:02 2010
@@ -3,13 +3,19 @@
use Catalyst::Test 'TestApp', {default_host => 'default.com'};
use Catalyst::Request;
-use Test::More tests => 8;
+use Test::More tests => 9;
content_like('/',qr/root/,'content check');
action_ok('/','Action ok ok','normal action ok');
action_redirect('/engine/response/redirect/one','redirect check');
action_notfound('/engine/response/status/s404','notfound check');
contenttype_is('/action/local/one','text/plain','Contenttype check');
+
+### local_request() was not setting response base from base href
+{
+ my $response = request('/base_href_test');
+ is( $response->base, 'http://www.example.com/', 'response base set from base href');
+}
my $creq;
my $req = '/dump/request';
Modified: trunk/libcatalyst-perl/t/optional_http-server-restart.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcatalyst-perl/t/optional_http-server-restart.t?rev=63076&op=diff
==============================================================================
--- trunk/libcatalyst-perl/t/optional_http-server-restart.t (original)
+++ trunk/libcatalyst-perl/t/optional_http-server-restart.t Wed Sep 29 01:14:02 2010
@@ -13,16 +13,13 @@
use LWP::Simple;
use IO::Socket;
use IPC::Open3;
-use Catalyst::Engine::HTTP::Restarter::Watcher;
use Time::HiRes qw/sleep/;
-eval "use Catalyst::Devel 1.0;";
+eval {require Catalyst::Devel; Catalyst::Devel->VERSION(1.0);};
plan skip_all => 'Catalyst::Devel required' if $@;
plan skip_all => 'Catalyst::Devel >= 1.04 required' if $Catalyst::Devel::VERSION <= 1.03;
eval "use File::Copy::Recursive";
plan skip_all => 'File::Copy::Recursive required' if $@;
-
-plan tests => 120;
my $tmpdir = "$FindBin::Bin/../t/tmp";
@@ -33,7 +30,7 @@
mkdir $tmpdir;
chdir $tmpdir;
-system( $^X, "-I$FindBin::Bin/../lib", "$FindBin::Bin/../script/catalyst.pl", 'TestApp' );
+system( $^X, "-I$FindBin::Bin/../lib", '-MFile::Spec', '-e', "\@ARGV=('TestApp'); my \$devnull = File::Spec->devnull; open my \$fh, '>', \$devnull or die \"Cannot write to \$devnull: \$!\"; *STDOUT = \$fh; do \"$FindBin::Bin/../script/catalyst.pl\"");
chdir "$FindBin::Bin/..";
File::Copy::Recursive::dircopy( 't/lib', 't/tmp/TestApp/lib' );
@@ -46,8 +43,8 @@
my( $server, $pid );
my @cmd = ($^X, "-I$FindBin::Bin/../lib", "-I$FindBin::Bin/lib",
- "$FindBin::Bin/../t/tmp/TestApp/script/testapp_server.pl", '-port',
- $port, '-restart');
+ "$FindBin::Bin/../t/tmp/TestApp/script/testapp_server.pl", '--port',
+ $port, '--restart');
$pid = open3( undef, $server, undef, @cmd )
or die "Unable to spawn standalone HTTP server: $!";
@@ -83,7 +80,7 @@
# give the server time to notice the change and restart
my $count = 0;
my $line;
- while ( ( $line || '' ) !~ /can connect/ ) {
+ while ( ( $line || '' ) !~ /ttempting to restart the server/ ) {
# wait for restart message
$line = $server->getline;
sleep 0.1;
@@ -110,45 +107,6 @@
sleep 1;
}
-# add errors to the file and make sure server does not die or restart
-NO_RESTART_ON_ERROR:
-for ( 1 .. 20 ) {
- my $index = rand @files;
- open my $pm, '>>', $files[$index]
- or die "Unable to open $files[$index] for writing: $!";
- print $pm "bleh";
- close $pm;
-
- my $count = 0;
- my $line;
-
- while ( ( $line || '' ) !~ /failed/ ) {
- # wait for restart message
- $line = $server->getline;
- sleep 0.1;
- if ( $count++ > 100 ) {
- fail "Server restarted";
- SKIP: {
- skip "Server didn't restart, no sense in checking response", 1;
- }
- next NO_RESTART_ON_ERROR;
- }
- };
-
- pass "Server refused to restart";
-
- if ( check_port( 'localhost', $port ) != 1 ) {
- die "Server appears to have died";
- }
- my $response = get("http://localhost:$port/action/default");
- like( $response, qr/Catalyst::Request/,
- 'Syntax error, no restart, request OK' );
-
- # give the server some time to reindex its files
- sleep 1;
-
-}
-
# multiple restart directories
# we need different options so we have to rebuild most
@@ -157,86 +115,10 @@
kill 'KILL', $pid;
close $server;
-# pick next port because the last one might still be blocked from
-# previous server. This might fail if this port is unavailable
-# but picking the first one has the same problem so this is acceptable
-
-$port += 1;
-
-{ no warnings 'once'; $File::Copy::Recursive::RMTrgFil = 1; }
-File::Copy::Recursive::dircopy( 't/lib', 't/tmp/TestApp/lib' );
-
-# change various files
- at files = (
- "$FindBin::Bin/../t/tmp/TestApp/lib/TestApp/Controller/Action/Begin.pm",
- "$FindBin::Bin/../t/tmp/TestApp/lib/TestApp/Controller/Engine/Request/URI.pm",
-);
-
-my $app_root = "$FindBin::Bin/../t/tmp/TestApp";
-my $restartdirs = join ' ', map{
- "-restartdirectory $app_root/lib/TestApp/Controller/$_"
-} qw/Action Engine/;
-
-$pid = open3( undef, $server, undef,
- $^X, "-I$FindBin::Bin/../lib",
- "$FindBin::Bin/../t/tmp/TestApp/script/testapp_server.pl", '-port',
- $port, '-restart', $restartdirs )
- or die "Unable to spawn standalone HTTP server: $!";
-$server->blocking( 0 );
-
-
-# wait for it to start
-print "Waiting for server to start...\n";
-while ( check_port( 'localhost', $port ) != 1 ) {
- sleep 1;
-}
-
-MULTI_DIR_RESTART:
-for ( 1 .. 20 ) {
- my $index = rand @files;
- open my $pm, '>>', $files[$index]
- or die "Unable to open $files[$index] for writing: $!";
- print $pm "\n";
- close $pm;
-
- # give the server time to notice the change and restart
- my $count = 0;
- my $line;
-
- while ( ( $line || '' ) !~ /can connect/ ) {
- # wait for restart message
- $line = $server->getline;
- sleep 0.1;
- if ( $count++ > 100 ) {
- fail "Server restarted";
- SKIP: {
- skip "Server didn't restart, no sense in checking response", 1;
- }
- next MULTI_DIR_RESTART;
- }
- };
- pass "Server restarted with multiple restartdirs";
-
- $count = 0;
- while ( check_port( 'localhost', $port ) != 1 ) {
- # wait for it to restart
- sleep 0.1;
- die "Server appears to have died" if $count++ > 100;
- }
- my $response = get("http://localhost:$port/action/default");
- like( $response, qr/Catalyst::Request/, 'Non-error restart, request OK' );
-
- # give the server some time to reindex its files
- sleep 1;
-}
-
-# shut it down again
-
-kill 'KILL', $pid;
-close $server;
-
# clean up
rmtree "$FindBin::Bin/../t/tmp" if -d "$FindBin::Bin/../t/tmp";
+
+done_testing;
sub check_port {
my ( $host, $port ) = @_;
Modified: trunk/libcatalyst-perl/t/optional_threads.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcatalyst-perl/t/optional_threads.t?rev=63076&op=diff
==============================================================================
--- trunk/libcatalyst-perl/t/optional_threads.t (original)
+++ trunk/libcatalyst-perl/t/optional_threads.t Wed Sep 29 01:14:02 2010
@@ -44,7 +44,7 @@
TestApp::Controller::Action::Default->begin
TestApp::Controller::Action::Default->default
TestApp::View::Dump::Request->process
- TestApp->end
+ TestApp::Controller::Root->end
];
my $expected = join( ", ", @expected );
Modified: trunk/libcatalyst-perl/t/unit_core_methodattributes_method_metaclass_on_subclasses.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcatalyst-perl/t/unit_core_methodattributes_method_metaclass_on_subclasses.t?rev=63076&op=diff
==============================================================================
--- trunk/libcatalyst-perl/t/unit_core_methodattributes_method_metaclass_on_subclasses.t (original)
+++ trunk/libcatalyst-perl/t/unit_core_methodattributes_method_metaclass_on_subclasses.t Wed Sep 29 01:14:02 2010
@@ -15,13 +15,13 @@
sub test {}
}
-
+my $c = 0;
foreach my $class (qw/ CT RT /) {
my $class_name = 'NoAttributes::' . $class;
my $meta = $class_name->meta;
my $meth = $meta->find_method_by_name('test');
{
- local $TODO = "Known MX::MethodAttributes issue";
+ local $TODO = "Known MX::MethodAttributes issue" if $c++;
ok $meth->can('attributes'), 'method metaclass has ->attributes method for ' . $class;;
}
}
More information about the Pkg-perl-cvs-commits
mailing list