/[Frey]/trunk/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

Contents of /trunk/t/02-frey-web.t

Parent Directory Parent Directory | Revision Log Revision Log


Revision 156 - (show annotations)
Thu Jul 17 17:55:39 2008 UTC (15 years, 9 months ago) by dpavlin
File MIME type: application/x-troff
File size: 1279 byte(s)
- simplify api to add_head
- rename frey css and prefix our classes with frey- to avoid conflicts
1 #!/usr/bin/perl
2 use strict;
3 use warnings;
4
5 use Test::More tests => 18;
6 use lib 'lib';
7
8 use Data::Dump qw/dump/;
9
10 my $debug = 1 if @ARGV;
11
12 BEGIN {
13 use_ok('Frey::Web');
14 use_ok('Frey');
15 use_ok('Test::HTML::Lint');
16 }
17
18 {
19 package Mock;
20 use Moose;
21 extends 'Frey';
22 with 'Frey::Web';
23 }
24
25 isa_ok( Frey::Web->meta, 'Moose::Meta::Role' );
26
27
28 ok( my $o = Mock->new( debug => $debug ), 'new' );
29 diag $o->dump(2) if $debug;
30
31 ok( $o->add_head( '/static/lib/Joose.js' ), 'add_head js' );
32
33 ok( my @head = $o->head, 'js' );
34
35 diag dump( @head ) if $debug;
36
37 ok( $o->add_head( '/static/introspect.css' ), 'add_head css' );
38
39 ok( my $html = $o->page( title => 'Test', body => '<!-- in-body -->' ), 'page' );
40 diag $html if $debug;
41
42 like( $html, qr{text/javascript.*\.js}, 'have js' );
43 like( $html, qr{text/css.*\.css}, 'have css' );
44
45 html_ok( $html, 'html lint' );
46
47 ok( my $s = $o->add_head( 'static/frey.css' ), 'add_head css' );
48 diag $s if $debug;
49 ok( $s = $o->add_head( 'static/js/ext-2.1/ext-all.js' ), 'add_head js' );
50 diag $s if $debug;
51
52 ok( my $html2 = $o->page( title => 'Test2', body => '<!-- in-body 2 -->' ), 'page' );
53 diag $html2 if $debug;
54
55 cmp_ok( length( $html ), '<', length( $html2 ), 'bigger html' );
56
57 like( $html2, qr{frey\.css}, 'have css' );
58 like( $html2, qr{ext}, 'have js' );

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26