X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F201-squirrel.t;h=c2fb73bd854b815428de659a0859a56c8f2447eb;hb=b03fda9f71bd6f81a435f1df67be4131da86189d;hp=198af9eb89d81cda24c7b9edf75cd81a9a27194b;hpb=eb061d5b0c1eea896c00ac732f6f4096255a79e3;p=gitmo%2FMouse.git diff --git a/t/201-squirrel.t b/t/201-squirrel.t index 198af9e..c2fb73b 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; @@ -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');