1Test::YAML::Valid(3)  User Contributed Perl Documentation Test::YAML::Valid(3)
2
3
4

NAME

6       Test::YAML::Valid - Test for valid YAML
7

VERSION

9       Version 0.04
10

SYNOPSIS

12       This module lets you easily test the validity of YAML:
13
14           use Test::More tests => 3;
15           use Test::YAML::Valid;
16
17           yaml_string_ok(YAML::Dump({foo => 'bar'}), 'YAML generates good YAML?');
18           yaml_string_ok('this is not YAML, is it?', 'This one will fail');
19           yaml_file_ok('/path/to/some/YAML', '/path/to/some/YAML is YAML');
20           yaml_files_ok('/path/to/YAML/files/*', 'all YAML files are valid');
21
22       You can also test with YAML::Syck instead of YAML by passing "-Syck" in
23       the import list:
24
25           use Test::YAML::Valid qw(-Syck);
26           yaml_string_ok(...); # uses YAML::Syck::Load instead of YAML::Load
27
28       It's up to you to make sure you have YAML::Syck if you specify the
29       "-Syck" option, since it's an optional prerequisite to this module.  If
30       it's requested but not found, a warning will be issued and YAML will be
31       used instead.
32
33       As of version 0.04, you can use any module you want in the same way;
34       "-Tiny" for YAML::Tiny and "-XS" for YAML::XS.
35

EXPORT

37       ·   yaml_string_ok
38
39       ·   yaml_file_ok
40
41       ·   yaml_files_ok
42

FUNCTIONS

44   yaml_string_ok($yaml, [$message])
45       Test will pass if $yaml contains valid YAML (according to YAML.pm) and
46       fail otherwise.  Returns the result of loading the YAML.
47
48   yaml_file_ok($filename, [$message])
49       Test will pass if $filename is a valid YAML file (according to YAML.pm)
50       and fail otherwise.  Returns the result of loading the YAML.
51
52   yaml_files_ok($file_glob_string, [$message])
53       Test will pass if all files matching the glob $file_glob_string contain
54       valid YAML.  If a file is not valid, the test will fail and no further
55       files will be examined.
56
57       Returns a list of all loaded YAML;
58

AUTHOR

60       Jonathan Rockway, "<jrockway at cpan.org>"
61

BUGS

63       Please report any bugs or feature requests to "bug-test-yaml-valid at
64       rt.cpan.org", or through the web interface at
65       http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Test-YAML-Valid
66       <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Test-YAML-Valid>.  I
67       will be notified, and then you'll automatically be notified of progress
68       on your bug as I make changes.
69

SUPPORT

71       You can find documentation for this module with the perldoc command.
72
73           perldoc Test::YAML::Valid
74
75       You can also look for information at:
76
77       ·   AnnoCPAN: Annotated CPAN documentation
78
79           http://annocpan.org/dist/Test-YAML-Valid
80           <http://annocpan.org/dist/Test-YAML-Valid>
81
82       ·   CPAN Ratings
83
84           http://cpanratings.perl.org/d/Test-YAML-Valid
85           <http://cpanratings.perl.org/d/Test-YAML-Valid>
86
87       ·   RT: CPAN's request tracker
88
89           http://rt.cpan.org/NoAuth/Bugs.html?Dist=Test-YAML-Valid
90           <http://rt.cpan.org/NoAuth/Bugs.html?Dist=Test-YAML-Valid>
91
92       ·   Search CPAN
93
94           http://search.cpan.org/dist/Test-YAML-Valid
95           <http://search.cpan.org/dist/Test-YAML-Valid>
96

ACKNOWLEDGEMENTS

98       Stevan Little "<stevan.little@iinteractive.com>" contributed
99       "yaml_files_ok" and some more tests.
100
102       Copyright 2007 Jonathan Rockway, all rights reserved.
103
104       This program is free software; you can redistribute it and/or modify it
105       under the same terms as Perl itself.
106
107
108
109perl v5.12.1                      2010-01-09              Test::YAML::Valid(3)
Impressum