[Catalyst-commits] r9320 - in Test-WWW-Mechanize-Catalyst/trunk: .
lib/Test/WWW/Mechanize t
ash at dev.catalyst.perl.org
ash at dev.catalyst.perl.org
Tue Feb 17 18:26:05 GMT 2009
Author: ash
Date: 2009-02-17 18:26:05 +0000 (Tue, 17 Feb 2009)
New Revision: 9320
Removed:
Test-WWW-Mechanize-Catalyst/trunk/t/pod_coverage.t
Modified:
Test-WWW-Mechanize-Catalyst/trunk/CHANGES
Test-WWW-Mechanize-Catalyst/trunk/lib/Test/WWW/Mechanize/Catalyst.pm
Log:
Version bump for release
Remove warnings in HTTP::Cookies.
Call BUILDALL
Modified: Test-WWW-Mechanize-Catalyst/trunk/CHANGES
===================================================================
--- Test-WWW-Mechanize-Catalyst/trunk/CHANGES 2009-02-17 01:33:55 UTC (rev 9319)
+++ Test-WWW-Mechanize-Catalyst/trunk/CHANGES 2009-02-17 18:26:05 UTC (rev 9320)
@@ -1,10 +1,14 @@
Revision history for Perl module Test::WWW::Mechanize::Catalyst:
-0.50_2 Thur Feb 12 09:47 GMT 2008
+0.50 Tue Feb 17 09:12 GMT 2009
+ - Remove warning in HTTP::Cookies
+ - Call BUILDALL
+
+0.50_2 Thur Feb 12 09:47 GMT 2009
- Make t/multi_content_type.t handle case when server cant be started,
which is almost always due to port in use.
-0.50_1 Thur Feb 5 09:02 GMT 2008
+0.50_1 Thur Feb 5 09:02 GMT 2009
- App classname no longer has to be passed to import:
$m = T::W::M::C->new(catalyst_app => 'Catty')
now works.
Modified: Test-WWW-Mechanize-Catalyst/trunk/lib/Test/WWW/Mechanize/Catalyst.pm
===================================================================
--- Test-WWW-Mechanize-Catalyst/trunk/lib/Test/WWW/Mechanize/Catalyst.pm 2009-02-17 01:33:55 UTC (rev 9319)
+++ Test-WWW-Mechanize-Catalyst/trunk/lib/Test/WWW/Mechanize/Catalyst.pm 2009-02-17 18:26:05 UTC (rev 9320)
@@ -12,7 +12,7 @@
use namespace::clean -execept => 'meta';
-our $VERSION = '0.50_2';
+our $VERSION = '0.50';
our $APP_CLASS;
my $Test = Test::Builder->new();
@@ -37,21 +37,38 @@
sub new {
my $class = shift;
- my $obj = $class->SUPER::new(@_);
+ my $args = ref $_[0] ? $_[0] : { @_ };
+
+ # Dont let LWP complain about options for our attributes
+ my %attr_options = map {
+ my $n = $_->init_arg;
+ defined $n && exists $args->{$n}
+ ? ( $n => delete $args->{$n} )
+ : ( );
+ } $class->meta->get_all_attributes;
+
+ my $obj = $class->SUPER::new(%$args);
my $self = $class->meta->new_object(
__INSTANCE__ => $obj,
($APP_CLASS ? (catalyst_app => $APP_CLASS) : () ),
- @_
+ %attr_options
);
+ $self->BUILDALL;
+
+
+ return $self;
+}
+
+sub BUILD {
+ my ($self) = @_;
+
unless ($ENV{CATALYST_SERVER}) {
croak "catalyst_app attribute is required unless CATALYST_SERVER env variable is set"
unless $self->has_catalyst_app;
Class::MOP::load_class($self->catalyst_app)
unless (Class::MOP::is_class_loaded($self->catalyst_app));
}
-
- return $self;
}
sub _make_request {
@@ -114,17 +131,16 @@
sub _do_catalyst_request {
my ($self, $request) = @_;
+ my $uri = $request->uri;
+ $uri->scheme('http') unless defined $uri->scheme;
+ $uri->host('localhost') unless defined $uri->host;
+
$self->cookie_jar->add_cookie_header($request) if $self->cookie_jar;
# Woe betide anyone who unsets CATALYST_SERVER
return Catalyst::Test::remote_request($request)
if $ENV{CATALYST_SERVER};
- my $uri = $request->uri;
- if ($uri->as_string =~ m{^/}) {
- $uri->scheme('http');
- $uri->host('localhost');
- }
# If there's no Host header, set one.
Deleted: Test-WWW-Mechanize-Catalyst/trunk/t/pod_coverage.t
===================================================================
--- Test-WWW-Mechanize-Catalyst/trunk/t/pod_coverage.t 2009-02-17 01:33:55 UTC (rev 9319)
+++ Test-WWW-Mechanize-Catalyst/trunk/t/pod_coverage.t 2009-02-17 18:26:05 UTC (rev 9320)
@@ -1,7 +0,0 @@
-#!perl -T
-
-use Test::More;
-eval "use Test::Pod::Coverage 1.04";
-plan skip_all => "Test::Pod::Coverage 1.04 required for testing POD coverage"
- if $@;
-all_pod_coverage_ok();
More information about the Catalyst-commits
mailing list