/[Frey]/branches/zimbardo/t/02-Frey-Web.t
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /branches/zimbardo/t/02-Frey-Web.t

Parent Directory Parent Directory | Revision Log Revision Log


Revision 648 - (hide annotations)
Sun Nov 30 19:21:52 2008 UTC (15 years, 5 months ago) by dpavlin
Original Path: trunk/t/02-frey-web.t
File MIME type: application/x-troff
File size: 1853 byte(s)
implement seek to end of last logged part and fix warnings_html
1 dpavlin 100 #!/usr/bin/perl
2     use strict;
3     use warnings;
4    
5 dpavlin 648 use Test::More tests => 29;
6 dpavlin 100 use lib 'lib';
7    
8 dpavlin 121 use Data::Dump qw/dump/;
9    
10 dpavlin 532 my $debug = @ARGV ? 0 : 1;
11 dpavlin 121
12 dpavlin 100 BEGIN {
13 dpavlin 648 use_ok('Frey::Bootstrap');
14 dpavlin 100 use_ok('Frey::Web');
15 dpavlin 121 use_ok('Frey');
16     use_ok('Test::HTML::Lint');
17 dpavlin 100 }
18    
19 dpavlin 121 {
20     package Mock;
21     use Moose;
22     extends 'Frey';
23     with 'Frey::Web';
24     }
25    
26 dpavlin 100 isa_ok( Frey::Web->meta, 'Moose::Meta::Role' );
27    
28 dpavlin 121
29 dpavlin 161 ok( my $o = Mock->new( debug => $debug, inline_smaller_than => 1 ), 'new' );
30 dpavlin 121 diag $o->dump(2) if $debug;
31    
32 dpavlin 156 ok( $o->add_head( '/static/lib/Joose.js' ), 'add_head js' );
33 dpavlin 121
34 dpavlin 156 ok( my @head = $o->head, 'js' );
35 dpavlin 121
36 dpavlin 156 diag dump( @head ) if $debug;
37 dpavlin 121
38 dpavlin 546 ok( $o->add_head( '/static/introspect.css' ), 'add_head css' );
39     ok( $o->add_head( "<!--\nhead comment\n-->" ), 'add_head comment' );
40     ok( $o->add_head( "<span>head html</span>>" ), 'add_head html' );
41 dpavlin 121
42 dpavlin 648 html_ok( $o->warnings_html, 'warnings_html' );
43    
44 dpavlin 121 ok( my $html = $o->page( title => 'Test', body => '<!-- in-body -->' ), 'page' );
45     diag $html if $debug;
46    
47     like( $html, qr{text/javascript.*\.js}, 'have js' );
48     like( $html, qr{text/css.*\.css}, 'have css' );
49 dpavlin 546 like( $html, qr{head comment}, 'have comment' );
50 dpavlin 444 like( $html, qr{head html}, 'have html' );
51 dpavlin 527 like( $html, qr{icon}, 'have icon' );
52 dpavlin 121
53     html_ok( $html, 'html lint' );
54 dpavlin 154
55 dpavlin 156 ok( my $s = $o->add_head( 'static/frey.css' ), 'add_head css' );
56 dpavlin 154 diag $s if $debug;
57     ok( $s = $o->add_head( 'static/js/ext-2.1/ext-all.js' ), 'add_head js' );
58     diag $s if $debug;
59    
60 dpavlin 418 ok( $o->title, 'has title' );
61    
62 dpavlin 154 ok( my $html2 = $o->page( title => 'Test2', body => '<!-- in-body 2 -->' ), 'page' );
63     diag $html2 if $debug;
64    
65     cmp_ok( length( $html ), '<', length( $html2 ), 'bigger html' );
66    
67 dpavlin 156 like( $html2, qr{frey\.css}, 'have css' );
68 dpavlin 154 like( $html2, qr{ext}, 'have js' );
69 dpavlin 460
70     ok( my $error = $o->error('test,ignore'), 'error' );
71     diag $error if $debug;
72     like( $error, qr{test,ignore.*$0}s, "have $0" );
73    
74 dpavlin 476 ok( $o->dump_max_bytes, 'dump_max_bytes' );
75 dpavlin 648

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26