/[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

Annotation of /trunk/t/02-frey-ppi.t

Parent Directory Parent Directory | Revision Log Revision Log


Revision 364 - (hide annotations)
Sun Nov 16 19:50:36 2008 UTC (15 years, 5 months ago) by dpavlin
File MIME type: application/x-troff
File size: 992 byte(s)
tweak various bits on Frey::PPI to wrap find within tree
in evals so we can *SEE* errors, and split out includes
which can be called externally. Support also values as from
type constraints.
1 dpavlin 331 #!/usr/bin/perl
2     use strict;
3     use warnings;
4    
5     my $debug = @ARGV ? 1 : 0;
6    
7 dpavlin 364 use Test::More tests => 13;
8 dpavlin 331 use lib 'lib';
9    
10     use Data::Dump qw/dump/;
11    
12     BEGIN {
13     use_ok('Frey::PPI');
14     }
15    
16 dpavlin 335 my $test = {
17 dpavlin 364 'Frey::DelIcioUs' => {
18     attribute_order => ["username", "password"],
19     includes => {
20     "use" => ["Moose", "LWP::UserAgent", "XML::Simple", "Data::Dump"],
21     },
22     },
23     'Frey::Feed' => {
24     attribute_order => ["uri", "feed", "title"],
25     includes => {
26     "use" => [ "Moose", "Frey::Types", "Frey::Mirror", "Data::Feed", "Data::Dump" ],
27     },
28     },
29 dpavlin 335 };
30 dpavlin 331
31 dpavlin 335 foreach my $class ( keys %$test ) {
32    
33     ok( my $o = Frey::PPI->new( class => $class, debug => $debug ), "new $class" );
34 dpavlin 364
35     my $data;
36    
37     ok( $data->{attribute_order} = $o->attribute_order, 'attribute_order' );
38     ok( $data->{includes} = $o->includes, 'includes' );
39     diag "data $class = ",dump( $data ) if $debug;
40    
41     foreach ( keys %$data ) {
42     is_deeply( $data->{$_}, $test->{$class}->{$_}, $_ );
43     }
44    
45     ok( $data = $o->data, 'data' );
46 dpavlin 335 diag dump( $data ) if $debug;
47    
48     }

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26