6 use Test::More tests => 8;
10 use_ok('MooseX::Storage');
15 This tests that the version and authority
16 checks are performed upon object expansion.
25 our $VERSION = '0.01';
26 our $AUTHORITY = 'cpan:JRANDOM';
30 has 'number' => (is => 'ro', isa => 'Int');
36 our $VERSION = '0.01';
37 our $AUTHORITY = 'cpan:JRANDOM';
49 bar => Bar->new(number => 1)
51 isa_ok( $foo, 'Foo' );
56 __CLASS__ => 'Foo-0.01-cpan:JRANDOM',
58 __CLASS__ => 'Bar-0.01-cpan:JRANDOM',
62 '... got the right frozen class'
67 my $foo = Foo->unpack(
69 __CLASS__ => 'Foo-0.01-cpan:JRANDOM',
71 __CLASS__ => 'Bar-0.01-cpan:JRANDOM',
76 isa_ok( $foo, 'Foo' );
77 isa_ok( $foo->bar, 'Bar' );
78 is( $foo->bar->number, 1 , '... got the right number too' );
82 Moose::Meta::Class->create('Bar',
84 authority => 'cpan:JRANDOM',
90 __CLASS__ => 'Foo-0.01-cpan:JRANDOM',
92 __CLASS__ => 'Bar-0.01-cpan:JRANDOM',
97 }, '... could not unpack, versions are different ' . $@);
99 Moose::Meta::Class->create('Bar',
101 authority => 'cpan:DSTATIC',
107 __CLASS__ => 'Foo-0.01-cpan:JRANDOM',
109 __CLASS__ => 'Bar-0.01-cpan:JRANDOM',
114 }, '... could not unpack, authorities are different');