--- trunk/t/02-frey-web.t 2008/07/13 19:46:10 120 +++ trunk/t/02-frey-web.t 2008/07/14 21:22:43 121 @@ -2,12 +2,44 @@ use strict; use warnings; -use Test::More tests => 2; +use Test::More tests => 12; use lib 'lib'; +use Data::Dump qw/dump/; + +my $debug = 1 if @ARGV; + BEGIN { use_ok('Frey::Web'); + use_ok('Frey'); + use_ok('Test::HTML::Lint'); +} + +{ + package Mock; + use Moose; + extends 'Frey'; + with 'Frey::Web'; } isa_ok( Frey::Web->meta, 'Moose::Meta::Role' ); + +ok( my $o = Mock->new( debug => $debug ), 'new' ); +diag $o->dump(2) if $debug; + +ok( $o->add_javascript( '/static/lib/Joose.js' ), 'add_javascript' ); + +ok( my @js = $o->javascript, 'javascript' ); + +diag dump( @js ) if $debug; + +ok( $o->add_css( '/static/introspect.css' ), 'add_css' ); + +ok( my $html = $o->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' ); + +html_ok( $html, 'html lint' );