X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F005_w_versions_and_authority_check.t;h=50b5a15ad657b7307bb8288146fe4cedb6792f6b;hb=c2d52f94beb56939250944a12df15d7d90779866;hp=cafb13a06ba66e43bdf2f257f00d0d57e33f8875;hpb=619ab942be0a8bd8f530c57ca5b0c8d833cdc89b;p=gitmo%2FMooseX-Storage.git diff --git a/t/005_w_versions_and_authority_check.t b/t/005_w_versions_and_authority_check.t index cafb13a..50b5a15 100644 --- a/t/005_w_versions_and_authority_check.t +++ b/t/005_w_versions_and_authority_check.t @@ -1,5 +1,3 @@ -#!/usr/bin/perl - use strict; use warnings; @@ -13,7 +11,7 @@ BEGIN { =pod -This tests that the version and authority +This tests that the version and authority checks are performed upon object expansion. =cut @@ -22,27 +20,27 @@ checks are performed upon object expansion. package Bar; use Moose; use MooseX::Storage; - + our $VERSION = '0.01'; our $AUTHORITY = 'cpan:JRANDOM'; with Storage; - + has 'number' => (is => 'ro', isa => 'Int'); - + package Foo; use Moose; use MooseX::Storage; our $VERSION = '0.01'; - our $AUTHORITY = 'cpan:JRANDOM'; + our $AUTHORITY = 'cpan:JRANDOM'; - with Storage; + with Storage; - has 'bar' => ( - is => 'ro', - isa => 'Bar' - ); + has 'bar' => ( + is => 'ro', + isa => 'Bar' + ); } { @@ -50,7 +48,7 @@ checks are performed upon object expansion. bar => Bar->new(number => 1) ); isa_ok( $foo, 'Foo' ); - + cmp_deeply( $foo->pack, { @@ -58,7 +56,7 @@ checks are performed upon object expansion. bar => { __CLASS__ => 'Bar-0.01-cpan:JRANDOM', number => 1, - } + } }, '... got the right frozen class' ); @@ -71,16 +69,16 @@ checks are performed upon object expansion. bar => { __CLASS__ => 'Bar-0.01-cpan:JRANDOM', number => 1, - } - }, + } + }, ); isa_ok( $foo, 'Foo' ); isa_ok( $foo->bar, 'Bar' ); is( $foo->bar->number, 1 , '... got the right number too' ); - + } -Moose::Meta::Class->create('Bar', +Moose::Meta::Class->create('Bar', version => '0.02', authority => 'cpan:JRANDOM', ); @@ -92,12 +90,12 @@ ok(exception { bar => { __CLASS__ => 'Bar-0.01-cpan:JRANDOM', number => 1, - } - } + } + } ); }, '... could not unpack, versions are different ' . $@); -Moose::Meta::Class->create('Bar', +Moose::Meta::Class->create('Bar', version => '0.01', authority => 'cpan:DSTATIC', ); @@ -109,7 +107,7 @@ ok(exception { bar => { __CLASS__ => 'Bar-0.01-cpan:JRANDOM', number => 1, - } - } + } + } ); }, '... could not unpack, authorities are different');