Commit | Line | Data |
be96f5c3 |
1 | #!/usr/bin/perl |
2 | |
3 | # Testing of common META.yml examples |
4 | |
5 | BEGIN { |
6 | if( $ENV{PERL_CORE} ) { |
7 | chdir 't'; |
8 | @INC = ('../lib', 'lib'); |
9 | } |
10 | else { |
11 | unshift @INC, 't/lib/'; |
12 | } |
13 | } |
14 | |
15 | use strict; |
16 | BEGIN { |
17 | $| = 1; |
18 | $^W = 1; |
19 | } |
20 | |
21 | use File::Spec::Functions ':ALL'; |
22 | use Parse::CPAN::Meta::Test; |
23 | use Test::More tests(1, 1); |
24 | |
25 | |
26 | |
27 | |
28 | |
29 | ##################################################################### |
30 | # Testing that Perl::Smith config files work |
31 | |
32 | my $sample_file = catfile( test_data_directory(), 'sample.yml' ); |
33 | my $sample = load_ok( 'sample.yml', $sample_file, 500 ); |
34 | |
35 | yaml_ok( |
36 | $sample, |
37 | [ { |
38 | invoice => 34843, |
39 | date => '2001-01-23', |
40 | 'bill-to' => { |
41 | given => 'Chris', |
42 | family => 'Dumars', |
43 | address => { |
44 | lines => "458 Walkman Dr.\nSuite #292\n", |
45 | city => 'Royal Oak', |
46 | state => 'MI', |
47 | postal => 48046, |
48 | }, |
49 | }, |
50 | product => [ |
51 | { |
52 | sku => 'BL394D', |
53 | quantity => '4', |
54 | description => 'Basketball', |
55 | price => '450.00', |
56 | }, |
57 | { |
58 | sku => 'BL4438H', |
59 | quantity => '1', |
60 | description => 'Super Hoop', |
61 | price => '2392.00', |
62 | }, |
63 | ], |
64 | tax => '251.42', |
65 | total => '4443.52', |
66 | comments => <<'END_TEXT', |
67 | Late afternoon is best. Backup contact is Nancy Billsmer @ 338-4338. |
68 | END_TEXT |
69 | } ], |
70 | 'sample.yml', |
de044c36 |
71 | # nosyck => 1, |
be96f5c3 |
72 | ); |