--- trunk/t/02-frey-web.t 2008/11/19 17:57:48 460 +++ branches/zimbardo/t/02-Frey-Web.t 2009/07/05 21:40:16 1172 @@ -2,14 +2,15 @@ use strict; use warnings; -use Test::More tests => 23; +use Test::More tests => 31; use lib 'lib'; use Data::Dump qw/dump/; -my $debug = 1 if @ARGV; +my $debug = @ARGV ? 0 : 1; BEGIN { + use_ok('Frey::Bootstrap'); use_ok('Frey::Web'); use_ok('Frey'); use_ok('Test::HTML::Lint'); @@ -34,15 +35,20 @@ diag dump( @head ) if $debug; -ok( $o->add_head( '/static/introspect.css' ), 'add_head css' ); -ok( $o->add_head( "" ), 'add_head html' ); +ok( $o->add_head( '/static/introspect.css' ), 'add_head css' ); +ok( $o->add_head( "" ), 'add_head comment' ); +ok( $o->add_head( "head html>" ), 'add_head html' ); -ok( my $html = $o->page( title => 'Test', body => '' ), 'page' ); +html_ok( $o->warnings_html, 'warnings_html' ); + +ok( my $html = $o->html_page( title => 'Test', body => '' ), 'page' ); diag $html if $debug; like( $html, qr{text/javascript.*\.js}, 'have js' ); like( $html, qr{text/css.*\.css}, 'have css' ); +like( $html, qr{head comment}, 'have comment' ); like( $html, qr{head html}, 'have html' ); +like( $html, qr{icon}, 'have icon' ); html_ok( $html, 'html lint' ); @@ -53,7 +59,7 @@ ok( $o->title, 'has title' ); -ok( my $html2 = $o->page( title => 'Test2', body => '' ), 'page' ); +ok( my $html2 = $o->html_page( title => 'Test2', body => '' ), 'page' ); diag $html2 if $debug; cmp_ok( length( $html ), '<', length( $html2 ), 'bigger html' ); @@ -65,3 +71,10 @@ diag $error if $debug; like( $error, qr{test,ignore.*$0}s, "have $0" ); +ok( $o->dump_max_bytes, 'dump_max_bytes' ); + +ok( $html = $o->html_self, 'html_self' ); +diag $html if $debug; +like( $html, qr{=HASH}s, "have self" ); + +