Move non-useful, Moose-specific methods into t/lib/Test/Mouse.pm
[gitmo/Mouse.git] / t / 029-new.t
index 9ad1721..b8a615b 100644 (file)
@@ -1,14 +1,16 @@
 #!/usr/bin/env perl
 use strict;
 use warnings;
-use Test::More tests => 4;
+use Test::More tests => 7;
 use Test::Exception;
 
 do {
     package Class;
     use Mouse;
 
-    has 'x';
+    has x => (
+        is => 'bare',
+    );
 
     has y => (
         is => 'ro',
@@ -28,3 +30,16 @@ throws_ok {
     Class->new('non-hashref scalar');
 } qr/Single parameters to new\(\) must be a HASH ref/;
 
+throws_ok {
+    Class->new(undef);
+} qr/Single parameters to new\(\) must be a HASH ref/;
+
+Class->meta->make_immutable;
+
+throws_ok {
+    Class->new([]);
+} qr/Single parameters to new\(\) must be a HASH ref/;
+
+throws_ok {
+    Class->new(Class->new);
+} qr/Single parameters to new\(\) must be a HASH ref/;