#!/usr/bin/perl
-
+$|++;
use strict;
use warnings;
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');
}
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{---
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
__CLASS__: Foo
number: 2
string: foo
-});
+}
+ );
isa_ok( $foo, 'Foo' );
is( $foo->number, 10, '... got the right number' );