summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/MooseX/Role/Matcher.pm2
-rw-r--r--t/002-complicated-matching.t2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/MooseX/Role/Matcher.pm b/lib/MooseX/Role/Matcher.pm
index 767bb1f..cdd9812 100644
--- a/lib/MooseX/Role/Matcher.pm
+++ b/lib/MooseX/Role/Matcher.pm
@@ -68,7 +68,7 @@ method match => sub {
# All the conditions must be true for true to be returned. Return
# immediately if a false condition is found.
for my $matcher (keys %args) {
- my ($invert, $name) = $matcher =~ /^(not_)?(.*)$/;
+ my ($invert, $name) = $matcher =~ /^(!)?(.*)$/;
my $value = $self->can($name) ? $self->$name : undef;
my $seek = $args{$matcher};
diff --git a/t/002-complicated-matching.t b/t/002-complicated-matching.t
index bcf2399..80d081c 100644
--- a/t/002-complicated-matching.t
+++ b/t/002-complicated-matching.t
@@ -21,5 +21,5 @@ ok($foo->match(a => [qr/b/, sub { length(shift) == 3 }]),
'arrayref matching works');
ok(!$foo->match(a => [qr/b/, sub { length(shift) == 4 }]),
'arrayref matching works');
-ok($foo->match(not_a => 'bar', b => 'bar', not_c => 'bar'),
+ok($foo->match('!a' => 'bar', b => 'bar', '!c' => 'bar'),
'negated matching works');