#!/usr/bin/env perl
use strict;
use warnings;
-use Test::More tests => 5;
-use Mouse::Util ':test';
+use Test::More tests => 7;
+use Test::Exception;
do {
package Class;
use Mouse;
- has 'x';
+ has x => (
+ is => 'bare',
+ );
has y => (
is => 'ro',
Class->new('non-hashref scalar');
} qr/Single parameters to new\(\) must be a HASH ref/;
-lives_ok {
+throws_ok {
Class->new(undef);
-} "Class->new(undef) specifically doesn't throw an error. weird"
+} qr/Single parameters to new\(\) must be a HASH ref/;
+Class->meta->make_immutable;
+
+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/;