/[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 121 - (hide annotations)
Mon Jul 14 21:22:43 2008 UTC (15 years, 9 months ago) by dpavlin
Original Path: trunk/t/02-frey-web.t
File MIME type: application/x-troff
File size: 858 byte(s)
central page creation [0.11]

- make (optional) development feature in Makefile.PL
- split page generation in Frey::Web->page
- cleanup of html generation code all over
- jump to Carp::REPL on errors (nice, but needs to be in browser)

This is a move to more embedded html. While it does seem evil, we are aming
here at lean framework, so readability is prefered...
1 dpavlin 100 #!/usr/bin/perl
2     use strict;
3     use warnings;
4    
5 dpavlin 121 use Test::More tests => 12;
6 dpavlin 100 use lib 'lib';
7    
8 dpavlin 121 use Data::Dump qw/dump/;
9    
10     my $debug = 1 if @ARGV;
11    
12 dpavlin 100 BEGIN {
13     use_ok('Frey::Web');
14 dpavlin 121 use_ok('Frey');
15     use_ok('Test::HTML::Lint');
16 dpavlin 100 }
17    
18 dpavlin 121 {
19     package Mock;
20     use Moose;
21     extends 'Frey';
22     with 'Frey::Web';
23     }
24    
25 dpavlin 100 isa_ok( Frey::Web->meta, 'Moose::Meta::Role' );
26    
27 dpavlin 121
28     ok( my $o = Mock->new( debug => $debug ), 'new' );
29     diag $o->dump(2) if $debug;
30    
31     ok( $o->add_javascript( '/static/lib/Joose.js' ), 'add_javascript' );
32    
33     ok( my @js = $o->javascript, 'javascript' );
34    
35     diag dump( @js ) if $debug;
36    
37     ok( $o->add_css( '/static/introspect.css' ), 'add_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' );

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26