* BUILDALL is now called by Moose::Meta::Class::new_object, rather than by
Moose::Object::new. (doy)
+ [NEW FEATURES]
+
+ * strict and warnings are now unimported when Moose, Moose::Role, or
+ Moose::Exporter are unimported. (doy, Adam Kennedy)
+
[BUG FIXES]
* Fix has '+attr' in Roles to explode immediately, rather than when the role
object construction process, and this should make C<< $meta->new_object >>
actually usable without forcing people to use C<< $meta->name->new >>.
+=item C<no Moose>, C<no Moose::Role>, and C<no Moose::Exporter> now unimport strict and warnings
+
+In the interest of having C<no Moose> clean up everything that C<use Moose>
+does in the calling scope, C<no Moose> (as well as all other
+L<Moose::Exporter>-using modules) now unimports strict and warnings.
+
=back
=head1 1.02
::ok($warn, '... got a warning');
::like($warn, qr/Argument \"hello\" isn\'t numeric in addition \(\+\)/, '.. and it is the right warning');
}
+
+ no Moose;
+ undef $@;
+ eval '$foo = 5;';
+ ::ok(!$@, "... no error after no Moose");
+
+ {
+ my $warn;
+ local $SIG{__WARN__} = sub { $warn = $_[0] };
+
+ ::ok(!$warn, '... no warning yet');
+
+ eval 'my $bar = 1 + "hello"';
+
+ ::ok(!$warn, '... still no warning');
+ }
}
# and for roles ...
::ok($warn, '... got a warning');
::like($warn, qr/Argument \"hello\" isn\'t numeric in addition \(\+\)/, '.. and it is the right warning');
}
+
+ no Moose::Role;
+ undef $@;
+ eval '$foo = 5;';
+ ::ok(!$@, "... no error after no Moose::Role");
+
+ {
+ my $warn;
+ local $SIG{__WARN__} = sub { $warn = $_[0] };
+
+ ::ok(!$warn, '... no warning yet');
+
+ eval 'my $bar = 1 + "hello"';
+
+ ::ok(!$warn, '... still no warning');
+ }
}
# and for exporters
package Bar;
use Moose::Exporter;
- eval '$foo = 5;';
+ eval '$foo2 = 5;';
::ok($@, '... got an error because strict is on');
- ::like($@, qr/Global symbol \"\$foo\" requires explicit package name at/, '... got the right error');
+ ::like($@, qr/Global symbol \"\$foo2\" requires explicit package name at/, '... got the right error');
{
my $warn;
::ok($warn, '... got a warning');
::like($warn, qr/Argument \"hello\" isn\'t numeric in addition \(\+\)/, '.. and it is the right warning');
}
+
+ no Moose::Exporter;
+ undef $@;
+ eval '$foo = 5;';
+ ::ok(!$@, "... no error after no Moose::Exporter");
+
+ {
+ my $warn;
+ local $SIG{__WARN__} = sub { $warn = $_[0] };
+
+ ::ok(!$warn, '... no warning yet');
+
+ eval 'my $bar = 1 + "hello"';
+
+ ::ok(!$warn, '... still no warning');
+ }
}
done_testing;