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