/[Frey]/trunk/t/02-frey-ppi.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 /trunk/t/02-frey-ppi.t

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

revision 331 by dpavlin, Sat Nov 8 16:12:39 2008 UTC revision 487 by dpavlin, Mon Nov 24 17:09:00 2008 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 => 5;  use Test::More tests => 17;
8  use lib 'lib';  use lib 'lib';
9    
10  use Data::Dump qw/dump/;  use Data::Dump qw/dump/;
# Line 13  BEGIN { Line 13  BEGIN {
13          use_ok('Frey::PPI');          use_ok('Frey::PPI');
14  }  }
15    
16  ok( my $o = Frey::PPI->new( class => 'Frey::DelIcioUs', debug => $debug ), 'new' );  my $test = {
17  ok( my @order = $o->attribute_order, 'attribute_order' );          'Frey::DelIcioUs' => {
18  diag dump( @order ) if $debug;                  attribute_order => ["username", "password"],
19  is_deeply( [ @order ], [ 'username', 'password', 'path' ], 'order correct' );                  includes => {
20  ok( my $data = $o->data, 'data' );                          "use" => ["Moose", "LWP::UserAgent", "XML::Simple", "Data::Dump"],
21  diag dump( $data ) if $debug;                  },
22                    has_tests => [],
23            },
24            'Frey::Feed' => {
25                    attribute_order => ["uri", "feed", "title"],
26                    includes => {
27                            "use" => [ "Moose", "Frey::Types", "Frey::Mirror", "Data::Feed", "Data::Dump" ],
28                    },
29                    has_tests => ["t/06-frey-feed.t"],
30            },
31    };
32    
33    foreach my $class ( keys %$test ) {
34    
35            ok( my $o = Frey::PPI->new( class => $class, debug => $debug ), "new $class" );
36    
37            my $data;
38    
39            ok( $data->{attribute_order} = $o->attribute_order, 'attribute_order' );
40            ok( $data->{includes} = $o->includes, 'includes' );
41            ok( $data->{has_tests} = $o->has_tests, 'has_tests' );
42            diag "data $class = ",dump( $data ) if $debug;
43    
44            foreach ( keys %$data ) {
45                    is_deeply( $data->{$_}, $test->{$class}->{$_}, $_ );
46            }
47    
48            ok( $data = $o->as_data, 'data' );
49            diag dump( $data ) if $debug;
50    
51    }

Legend:
Removed from v.331  
changed lines
  Added in v.487

  ViewVC Help
Powered by ViewVC 1.1.26