6 use Test::More tests => 8;
11 use_ok('MooseX::Storage');
16 This tests that the version and authority
17 checks are performed upon object expansion.
26 our $VERSION = '0.01';
27 our $AUTHORITY = 'cpan:JRANDOM';
31 has 'number' => (is => 'ro', isa => 'Int');
37 our $VERSION = '0.01';
38 our $AUTHORITY = 'cpan:JRANDOM';
50 bar => Bar->new(number => 1)
52 isa_ok( $foo, 'Foo' );
57 __CLASS__ => 'Foo-0.01-cpan:JRANDOM',
59 __CLASS__ => 'Bar-0.01-cpan:JRANDOM',
63 '... got the right frozen class'
68 my $foo = Foo->unpack(
70 __CLASS__ => 'Foo-0.01-cpan:JRANDOM',
72 __CLASS__ => 'Bar-0.01-cpan:JRANDOM',
77 isa_ok( $foo, 'Foo' );
78 isa_ok( $foo->bar, 'Bar' );
79 is( $foo->bar->number, 1 , '... got the right number too' );
83 Moose::Meta::Class->create('Bar',
85 authority => 'cpan:JRANDOM',
91 __CLASS__ => 'Foo-0.01-cpan:JRANDOM',
93 __CLASS__ => 'Bar-0.01-cpan:JRANDOM',
98 }, '... could not unpack, versions are different ' . $@);
100 Moose::Meta::Class->create('Bar',
102 authority => 'cpan:DSTATIC',
108 __CLASS__ => 'Foo-0.01-cpan:JRANDOM',
110 __CLASS__ => 'Bar-0.01-cpan:JRANDOM',
115 }, '... could not unpack, authorities are different');