[Catalyst-commits] r8844 - in Catalyst-View-TT-XHTML/1.000/trunk: .
lib/Catalyst/View/TT t
t0m at dev.catalyst.perl.org
t0m at dev.catalyst.perl.org
Fri Dec 12 11:52:55 GMT 2008
Author: t0m
Date: 2008-12-12 11:52:55 +0000 (Fri, 12 Dec 2008)
New Revision: 8844
Modified:
Catalyst-View-TT-XHTML/1.000/trunk/
Catalyst-View-TT-XHTML/1.000/trunk/Changes
Catalyst-View-TT-XHTML/1.000/trunk/Makefile
Catalyst-View-TT-XHTML/1.000/trunk/lib/Catalyst/View/TT/XHTML.pm
Catalyst-View-TT-XHTML/1.000/trunk/t/live-test.t
Log:
Add tests showing how retarded my implementation is. Also remove Makefile from revision control. Fail-whale.
Property changes on: Catalyst-View-TT-XHTML/1.000/trunk
___________________________________________________________________
Name: svn:ignore
- MANIFEST
blib
inc
META.yml
pm_to_blib
.*.swp
+ MANIFEST
blib
inc
META.yml
pm_to_blib
.*.swp
Makefile
Modified: Catalyst-View-TT-XHTML/1.000/trunk/Changes
===================================================================
--- Catalyst-View-TT-XHTML/1.000/trunk/Changes 2008-12-12 10:46:40 UTC (rev 8843)
+++ Catalyst-View-TT-XHTML/1.000/trunk/Changes 2008-12-12 11:52:55 UTC (rev 8844)
@@ -1,4 +1,6 @@
+ - Add tests for other Accept header cases where the current code
+ will get it wrong (David Dorward)
1.000
- First working version of the module extracted from the quick hack
I have in every Catalyst application I've ever written.
-
\ No newline at end of file
+
Modified: Catalyst-View-TT-XHTML/1.000/trunk/Makefile
===================================================================
--- Catalyst-View-TT-XHTML/1.000/trunk/Makefile 2008-12-12 10:46:40 UTC (rev 8843)
+++ Catalyst-View-TT-XHTML/1.000/trunk/Makefile 2008-12-12 11:52:55 UTC (rev 8844)
@@ -17,9 +17,8 @@
# NAME => q[Catalyst::View::TT::XHTML]
# NO_META => q[1]
# PL_FILES => { }
-# PREREQ_PM => { Catalyst::View::TT=>q[0], ok=>q[0], Test::More=>q[0], ExtUtils::MakeMaker=>q[6.42], Catalyst::Runtime=>q[0], Test::WWW::Mechanize::Catalyst=>q[0], Catalyst::Action::RenderView=>q[0] }
-# VERSION => q[0.001000]
-# clean => { FILES=>q[META.yml] }
+# PREREQ_PM => { Catalyst::View::TT=>q[0], Test::More=>q[0], ExtUtils::MakeMaker=>q[6.42], Catalyst::Runtime=>q[0], Test::WWW::Mechanize::Catalyst=>q[0], Catalyst::Action::RenderView=>q[0] }
+# VERSION => q[1.000]
# dist => { PREOP=>q[$(PERL) -I. "-MModule::Install::Admin" -e "dist_preop(q($(DISTVNAME)))"] }
# --- MakeMaker post_initialize section:
@@ -60,11 +59,11 @@
DFSEP = $(DIRFILESEP)
NAME = Catalyst::View::TT::XHTML
NAME_SYM = Catalyst_View_TT_XHTML
-VERSION = 0.001000
+VERSION = 1.000
VERSION_MACRO = VERSION
-VERSION_SYM = 0_001000
+VERSION_SYM = 1_000
DEFINE_VERSION = -D$(VERSION_MACRO)=\"$(VERSION)\"
-XS_VERSION = 0.001000
+XS_VERSION = 1.000
XS_VERSION_MACRO = XS_VERSION
XS_DEFINE_VERSION = -D$(XS_VERSION_MACRO)=\"$(XS_VERSION)\"
INST_ARCHLIB = blib/arch
@@ -255,7 +254,7 @@
DIST_CP = best
DIST_DEFAULT = tardist
DISTNAME = Catalyst-View-TT-XHTML
-DISTVNAME = Catalyst-View-TT-XHTML-0.001000
+DISTVNAME = Catalyst-View-TT-XHTML-1.000
# --- MakeMaker macro section:
@@ -453,7 +452,7 @@
perl.exe so_locations \
$(BASEEXT).exp
- $(RM_RF) \
- META.yml blib
+ blib
- $(MV) $(FIRST_MAKEFILE) $(MAKEFILE_OLD) $(DEV_NULL)
@@ -763,7 +762,7 @@
# --- MakeMaker ppd section:
# Creates a PPD (Perl Package Description) for a binary distribution.
ppd :
- $(NOECHO) $(ECHO) '<SOFTPKG NAME="$(DISTNAME)" VERSION="0,001000,0,0">' > $(DISTNAME).ppd
+ $(NOECHO) $(ECHO) '<SOFTPKG NAME="$(DISTNAME)" VERSION="1,000,0,0">' > $(DISTNAME).ppd
$(NOECHO) $(ECHO) ' <TITLE>$(DISTNAME)</TITLE>' >> $(DISTNAME).ppd
$(NOECHO) $(ECHO) ' <ABSTRACT>A sub-class of the standard TT view which</ABSTRACT>' >> $(DISTNAME).ppd
$(NOECHO) $(ECHO) ' <AUTHOR>Tomas Doran C<< <bobtfish at bobtfish.net> >></AUTHOR>' >> $(DISTNAME).ppd
@@ -774,7 +773,6 @@
$(NOECHO) $(ECHO) ' <DEPENDENCY NAME="ExtUtils-MakeMaker" VERSION="6,42,0,0" />' >> $(DISTNAME).ppd
$(NOECHO) $(ECHO) ' <DEPENDENCY NAME="Test-More" VERSION="0,0,0,0" />' >> $(DISTNAME).ppd
$(NOECHO) $(ECHO) ' <DEPENDENCY NAME="Test-WWW-Mechanize-Catalyst" VERSION="0,0,0,0" />' >> $(DISTNAME).ppd
- $(NOECHO) $(ECHO) ' <DEPENDENCY NAME="ok" VERSION="0,0,0,0" />' >> $(DISTNAME).ppd
$(NOECHO) $(ECHO) ' <OS NAME="$(OSNAME)" />' >> $(DISTNAME).ppd
$(NOECHO) $(ECHO) ' <ARCHITECTURE NAME="darwin-thread-multi-2level-5.8" />' >> $(DISTNAME).ppd
$(NOECHO) $(ECHO) ' <CODEBASE HREF="" />' >> $(DISTNAME).ppd
Modified: Catalyst-View-TT-XHTML/1.000/trunk/lib/Catalyst/View/TT/XHTML.pm
===================================================================
--- Catalyst-View-TT-XHTML/1.000/trunk/lib/Catalyst/View/TT/XHTML.pm 2008-12-12 10:46:40 UTC (rev 8843)
+++ Catalyst-View-TT-XHTML/1.000/trunk/lib/Catalyst/View/TT/XHTML.pm 2008-12-12 11:52:55 UTC (rev 8844)
@@ -71,6 +71,14 @@
Tomas Doran C<< <bobtfish at bobtfish.net> >>
+=head1 CONTRIBUTORS
+
+=over
+
+=item David Dorward - test patches
+
+=back
+
=head1 COPYRIGHT
This module itself is copyright (c) 2008 Tomas Doran and is licensed under the same terms as Perl itself.
Modified: Catalyst-View-TT-XHTML/1.000/trunk/t/live-test.t
===================================================================
--- Catalyst-View-TT-XHTML/1.000/trunk/t/live-test.t 2008-12-12 10:46:40 UTC (rev 8843)
+++ Catalyst-View-TT-XHTML/1.000/trunk/t/live-test.t 2008-12-12 11:52:55 UTC (rev 8844)
@@ -2,7 +2,7 @@
use strict;
use warnings;
-use Test::More tests => 13;
+use Test::More tests => 22;
# setup library path
use FindBin qw($Bin);
@@ -42,3 +42,27 @@
$mech->content_like(qr/not html/i, 'see if it has our text');
is $mech->response->headers->{'content-type'}, 'application/json',
'application/json is unmolested';
+
+# 14-16
+$mech->add_header( Accept => 'text/html, application/xhtml+xml');
+$mech->get_ok('http://localhost/', 'get main page');
+$mech->content_like(qr/it works/i, 'see if it has our text');
+is $mech->response->headers->{'content-type'}, 'application/xhtml+xml; charset=utf-8',
+ 'Accept xhtml AND html gives content type application/xhtml+xml';
+
+
+# 17-19
+$mech->add_header( Accept => 'text/html, application/xhtml+xml;q=0');
+$mech->get_ok('http://localhost/', 'get main page');
+$mech->content_like(qr/it works/i, 'see if it has our text');
+is $mech->response->headers->{'content-type'}, 'text/html; charset=utf-8',
+ 'Accept header of application/xhtml+xml with q value of 0 and text/html = text/html';
+
+# 20-22
+$mech->add_header( Accept => 'text/html;q=0');
+$mech->get_ok('http://localhost/', 'get main page');
+$mech->content_like(qr/it works/i, 'see if it has our text');
+is $mech->response->headers->{'content-type'}, 'application/xhtml+xml; charset=utf-8',
+ 'Accept html with a q value of 0 gives content type application/xhtml+xml';
+
+
More information about the Catalyst-commits
mailing list