1 |
dpavlin |
369 |
#!/usr/bin/perl |
2 |
|
|
use strict; |
3 |
|
|
use warnings; |
4 |
|
|
|
5 |
|
|
my $debug = @ARGV ? 1 : 0; |
6 |
|
|
|
7 |
|
|
use Test::More tests => 8; |
8 |
|
|
use lib 'lib'; |
9 |
|
|
|
10 |
|
|
use Data::Dump qw/dump/; |
11 |
|
|
|
12 |
|
|
BEGIN { |
13 |
|
|
use_ok('Frey::Action'); |
14 |
|
|
} |
15 |
|
|
|
16 |
|
|
ok( my $o = Frey::Action->new( class => 'Frey::Feed', debug => $debug ), "new Frey::Feed" ); |
17 |
|
|
|
18 |
|
|
ok( my $required = $o->required, 'required' ); |
19 |
|
|
diag dump( $required ) if $debug; |
20 |
|
|
isa_ok( $required, 'ARRAY', 'required' ); |
21 |
|
|
|
22 |
|
|
ok( my $attributes = $o->attributes, 'attributes' ); |
23 |
|
|
diag dump( $attributes ) if $debug; |
24 |
|
|
is_deeply( $attributes, ["uri", "feed", "title"], 'attributes' ); |
25 |
|
|
|
26 |
|
|
ok( my $html = $o->params_form, 'params_form' ); |
27 |
|
|
diag $html if $debug; |
28 |
|
|
like( $html, qr/<form/, 'has form' ); |
29 |
|
|
|
30 |
|
|
|
31 |
|
|
ok( $o = Frey::Action->new( class => 'Frey::ClassBrowser', debug => $debug ), "new Frey::ClassBrowser" ); |
32 |
|
|
ok( ! $o->params_form, 'no form' ); |