Upgrade to Parse::CPAN::Meta 1.38
[p5sagit/p5-mst-13.2.git] / t / lib / Parse / CPAN / Meta / Test.pm
index 319317a..46f967b 100644 (file)
@@ -9,7 +9,10 @@ use vars qw{@ISA @EXPORT};
 BEGIN {
        require Exporter;
        @ISA    = qw{ Exporter };
-       @EXPORT = qw{ tests  yaml_ok  slurp  load_ok  test_data_directory };
+       @EXPORT = qw{
+               tests  yaml_ok  yaml_error  slurp  load_ok
+               test_data_directory
+       };
 }
 
 sub test_data_directory {
@@ -53,6 +56,12 @@ sub yaml_ok {
        return 1;
 }
 
+sub yaml_error {
+       my $string = shift;
+       my $yaml   = eval { Parse::CPAN::Meta::Load( $string ); };
+       Test::More::like( $@, qr/$_[0]/, "YAML::Tiny throws expected error" );
+}
+
 sub slurp {
        my $file = shift;
        local $/ = undef;