4 use Test::More tests => 8;
9 use_ok('MooseX::Storage');
14 This tests that the version and authority
15 checks are performed upon object expansion.
24 our $VERSION = '0.01';
25 our $AUTHORITY = 'cpan:JRANDOM';
29 has 'number' => (is => 'ro', isa => 'Int');
35 our $VERSION = '0.01';
36 our $AUTHORITY = 'cpan:JRANDOM';
48 bar => Bar->new(number => 1)
50 isa_ok( $foo, 'Foo' );
55 __CLASS__ => 'Foo-0.01-cpan:JRANDOM',
57 __CLASS__ => 'Bar-0.01-cpan:JRANDOM',
61 '... got the right frozen class'
66 my $foo = Foo->unpack(
68 __CLASS__ => 'Foo-0.01-cpan:JRANDOM',
70 __CLASS__ => 'Bar-0.01-cpan:JRANDOM',
75 isa_ok( $foo, 'Foo' );
76 isa_ok( $foo->bar, 'Bar' );
77 is( $foo->bar->number, 1 , '... got the right number too' );
81 Moose::Meta::Class->create('Bar',
83 authority => 'cpan:JRANDOM',
89 __CLASS__ => 'Foo-0.01-cpan:JRANDOM',
91 __CLASS__ => 'Bar-0.01-cpan:JRANDOM',
96 }, '... could not unpack, versions are different ' . $@);
98 Moose::Meta::Class->create('Bar',
100 authority => 'cpan:DSTATIC',
106 __CLASS__ => 'Foo-0.01-cpan:JRANDOM',
108 __CLASS__ => 'Bar-0.01-cpan:JRANDOM',
113 }, '... could not unpack, authorities are different');