X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F201-squirrel.t;h=daeed221d206528bb7cd0b19052e52f9aa89923a;hb=de3f9ba5c62f6e2b1cf64d057ffef60224b4204a;hp=198af9eb89d81cda24c7b9edf75cd81a9a27194b;hpb=eb061d5b0c1eea896c00ac732f6f4096255a79e3;p=gitmo%2FMouse.git diff --git a/t/201-squirrel.t b/t/201-squirrel.t index 198af9e..daeed22 100644 --- a/t/201-squirrel.t +++ b/t/201-squirrel.t @@ -6,6 +6,11 @@ use warnings; use Test::More; use Scalar::Util 'blessed'; +# Don't spew deprecation warnings onto the user's screen +BEGIN { + $SIG{__WARN__} = sub { warn $_[0] if $_[0] !~ /Squirrel is deprecated/ }; +} + do { package Foo; use Squirrel; @@ -22,7 +27,7 @@ do { # affecting its definition BEGIN { - plan skip_all => "Moose required for this test" unless eval { require Moose }; + plan skip_all => "Moose 0.68 required for this test" unless eval { require Moose && Moose->VERSION('0.68') }; plan tests => 12; } @@ -56,12 +61,15 @@ eval " use Squirrel; has bar => (is => 'rw'); + __PACKAGE__->meta->make_immutable; package Bar; use Squirrel; has bar => (is => 'rw'); + __PACKAGE__->meta->make_immutable; "; +warn $@ if $@; is(blessed(Foo->meta->get_attribute('foo')), 'Mouse::Meta::Attribute'); is(blessed(Foo->meta->get_attribute('bar')), 'Mouse::Meta::Attribute', 'Squirrel is consistent if Moose was loaded between imports');