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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 487 - (hide annotations)
Mon Nov 24 17:09:00 2008 UTC (15 years, 5 months ago) by dpavlin
Original Path: trunk/t/02-frey-ppi.t
File MIME type: application/x-troff
File size: 1107 byte(s)
added has_tests which return all tests which use_ok class
1 dpavlin 331 #!/usr/bin/perl
2     use strict;
3     use warnings;
4    
5     my $debug = @ARGV ? 1 : 0;
6    
7 dpavlin 487 use Test::More tests => 17;
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 dpavlin 487 has_tests => [],
23 dpavlin 364 },
24     'Frey::Feed' => {
25     attribute_order => ["uri", "feed", "title"],
26     includes => {
27     "use" => [ "Moose", "Frey::Types", "Frey::Mirror", "Data::Feed", "Data::Dump" ],
28     },
29 dpavlin 487 has_tests => ["t/06-frey-feed.t"],
30 dpavlin 364 },
31 dpavlin 335 };
32 dpavlin 331
33 dpavlin 335 foreach my $class ( keys %$test ) {
34    
35     ok( my $o = Frey::PPI->new( class => $class, debug => $debug ), "new $class" );
36 dpavlin 364
37     my $data;
38    
39     ok( $data->{attribute_order} = $o->attribute_order, 'attribute_order' );
40     ok( $data->{includes} = $o->includes, 'includes' );
41 dpavlin 487 ok( $data->{has_tests} = $o->has_tests, 'has_tests' );
42 dpavlin 364 diag "data $class = ",dump( $data ) if $debug;
43    
44     foreach ( keys %$data ) {
45     is_deeply( $data->{$_}, $test->{$class}->{$_}, $_ );
46     }
47    
48 dpavlin 455 ok( $data = $o->as_data, 'data' );
49 dpavlin 335 diag dump( $data ) if $debug;
50    
51     }

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26