summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordoy <doy@tozt.net>2008-12-06 23:39:24 -0500
committerdoy <doy@tozt.net>2008-12-06 23:39:24 -0500
commit6bbd36711c3a8ddc93a949b1c254ce33824659d4 (patch)
tree57ace73ef3c2cf21635c32ebfa05e2a91ff0725e
parenta79bf3fb60ae2a98e17ed8bb1144a28eec8849f3 (diff)
downloadmoosex-role-matcher-6bbd36711c3a8ddc93a949b1c254ce33824659d4.tar.gz
moosex-role-matcher-6bbd36711c3a8ddc93a949b1c254ce33824659d4.zip
test matching against undef
-rw-r--r--t/001-basic-matching.t6
1 files changed, 4 insertions, 2 deletions
diff --git a/t/001-basic-matching.t b/t/001-basic-matching.t
index c9c589c..52003ac 100644
--- a/t/001-basic-matching.t
+++ b/t/001-basic-matching.t
@@ -1,7 +1,7 @@
#!/usr/bin/env perl
use strict;
use warnings;
-use Test::More tests => 4;
+use Test::More tests => 5;
package Foo;
use Moose;
@@ -10,7 +10,6 @@ with 'MooseX::Role::Matcher';
has [qw/a b c/] => (
is => 'ro',
isa => 'Str',
- required => 1,
);
package main;
@@ -23,3 +22,6 @@ ok($foo->match(b => sub { length(shift) == 3 }),
'subroutine matching works');
ok($foo->match(a => 'foo', b => qr/a/, c => sub { substr(shift, 2) eq 'z' }),
'combined matching works');
+$foo = Foo->new(a => 'foo');
+ok($foo->match(a => 'foo', b => undef),
+ 'matching against undef works');