X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F020_basic_yaml.t;h=87e3faecace59de1cf419553c4eebd45ea79a76e;hb=cfd008fa25b3cdd9721ef2fad9f4383cdc200ddc;hp=36ee6053a79d3609529a86111607e347136f1f60;hpb=8d8356bb0a96c1c4e909b56c812b16fc82c7bbd2;p=gitmo%2FMooseX-Storage.git diff --git a/t/020_basic_yaml.t b/t/020_basic_yaml.t index 36ee605..87e3fae 100644 --- a/t/020_basic_yaml.t +++ b/t/020_basic_yaml.t @@ -1,5 +1,5 @@ #!/usr/bin/perl - +$|++; use strict; use warnings; @@ -7,7 +7,9 @@ use Test::More; BEGIN { eval "use Test::YAML::Valid"; - plan skip_all => "Test::YAML::Valid is required for this test" if $@; + plan skip_all => "Test::YAML::Valid is required for this test" if $@; + eval "use Best [[qw(YAML::Syck YAML)]]"; + plan skip_all => "YAML or YAML::syck and Best are required for this test" if $@; plan tests => 12; use_ok('MooseX::Storage'); } @@ -38,11 +40,11 @@ BEGIN { object => Foo->new( number => 2 ), ); isa_ok( $foo, 'Foo' ); - + my $yaml = $foo->freeze; - - yaml_string_ok($yaml, '... we got valid YAML out of it'); - + + yaml_string_ok( $yaml, '... we got valid YAML out of it' ); + is( $yaml, q{--- @@ -76,12 +78,14 @@ object: number: 2 string: foo }, - '... got the same YAML'); - + '... got the same YAML' + ); + } { - my $foo = Foo->thaw(q{--- + my $foo = Foo->thaw( + q{--- __CLASS__: Foo array: - 1 @@ -111,7 +115,8 @@ object: __CLASS__: Foo number: 2 string: foo -}); +} + ); isa_ok( $foo, 'Foo' ); is( $foo->number, 10, '... got the right number' );