projects
/
gitmo/MooseX-UndefTolerant.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
(parent:
64c5128
)
improve test by testing for explicit exception message
Karen Etheridge [Sun, 11 Mar 2012 00:56:19 +0000 (16:56 -0800)]
t/constructor.t
patch
|
blob
|
blame
|
history
diff --git
a/t/constructor.t
b/t/constructor.t
index
22d4ce2
..
90e8ea1
100644
(file)
--- a/
t/constructor.t
+++ b/
t/constructor.t
@@
-60,7
+60,9
@@
sub do_tests
{
my $obj = Foo->new(attr1 => undef);
ok(!$obj->has_attr1, 'UT attr1 has no value when assigned undef in constructor');
- isnt (exception { $obj = Foo->new(attr2 => undef) }, undef,
+ like(
+ exception { $obj = Foo->new(attr2 => undef) },
+ qr/\QAttribute (attr2) does not pass the type constraint because: Validation failed for 'Num' with value undef\E/,
'But assigning undef to attr2 generates a type constraint error');
is (exception { $obj = Foo->new(attr3 => undef) }, undef,