/[Frey]/branches/zimbardo/t/01-Frey-Action.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

Diff of /branches/zimbardo/t/01-Frey-Action.t

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

trunk/t/01-frey-action.t revision 502 by dpavlin, Mon Nov 24 21:49:38 2008 UTC branches/zimbardo/t/01-Frey-Action.t revision 1172 by dpavlin, Sun Jul 5 21:40:16 2009 UTC
# Line 4  use warnings; Line 4  use warnings;
4    
5  my $debug = @ARGV ? 1 : 0;  my $debug = @ARGV ? 1 : 0;
6    
7  use Test::More tests => 26;  use Test::More tests => 28;
8  use lib 'lib';  use lib 'lib';
9    
10  use Data::Dump qw/dump/;  use Data::Dump qw/dump/;
# Line 19  ok( my $required = $o->required, 'requir Line 19  ok( my $required = $o->required, 'requir
19  diag ref( $required ) if $debug;  diag ref( $required ) if $debug;
20  isa_ok( $required, 'ARRAY', 'required' );  isa_ok( $required, 'ARRAY', 'required' );
21    
22    ok( $required = $o->required( as_hash => 1 ), 'required as_hash' );
23    diag dump $required;
24    isa_ok( $required, 'HASH', 'hash' );
25    
26  ok( my $attributes = $o->attributes, 'attributes' );  ok( my $attributes = $o->attributes, 'attributes' );
27  diag dump( $attributes ) if $debug;  diag dump( $attributes ) if $debug;
28  is_deeply( $attributes, ["uri", "feed", "title"], 'attributes' );  is_deeply( $attributes, ["uri", "feed", "title"], 'attributes' );
# Line 44  ok( $html2, 'got form again' ); Line 48  ok( $html2, 'got form again' );
48  cmp_ok( $html, 'eq', $html2, 'html same' );  cmp_ok( $html, 'eq', $html2, 'html same' );
49  ok( $default->{uri}, 'uri has default' );  ok( $default->{uri}, 'uri has default' );
50    
51  ok( $o = Frey::Action->new( class => 'Frey::ClassBrowser', debug => $debug, params => { unneeded => 1 } ), "new Frey::ClassBrowser" );  ok( $o = Frey::Action->new( class => 'Frey::Class::Browser', debug => $debug, params => { unneeded => 1 } ), "new Frey::Class::Browser" );
52  ok( ($html2,$default) = $o->params_form, 'params_form' );  ok( ($html2,$default) = $o->params_form, 'params_form' );
53  ok( ! $html2, 'no form' );  ok( ! $html2, 'no form' );
54  ok( $default->{unneeded}, 'preserve params' );  ok( $default->{unneeded}, 'preserve params' );
# Line 54  ok( $html = $o->params_form, 'params_for Line 58  ok( $html = $o->params_form, 'params_for
58  diag $html if $debug;  diag $html if $debug;
59  like( $html, qr/class/, 'required form field class' );  like( $html, qr/class/, 'required form field class' );
60    
61  ok( $o = Frey::Action->new( class => 'Frey::Introspect', params => { class => 'Frey' }, debug => $debug ), "new Frey::Introspect" );  ok( $o = Frey::Action->new( class => 'Frey::Introspect', params => { request_url => '/', class => 'Frey' }, debug => $debug ), "new Frey::Introspect" );
62  ok( ! $o->params_form, 'params_form empty' );  ok( ! $o->params_form, 'params_form empty' );
63    diag $o->params_form if $o->params_form;
64    

Legend:
Removed from v.502  
changed lines
  Added in v.1172

  ViewVC Help
Powered by ViewVC 1.1.26