summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--t/102-missing.t21
1 files changed, 21 insertions, 0 deletions
diff --git a/t/102-missing.t b/t/102-missing.t
new file mode 100644
index 0000000..09f4bc6
--- /dev/null
+++ b/t/102-missing.t
@@ -0,0 +1,21 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use Test::More tests => 2;
+
+package Foo;
+use Moose;
+with 'MooseX::Role::Matcher';
+
+has [qw/a b c/] => (
+ is => 'ro',
+ isa => 'Str',
+);
+
+package main;
+my $foo = Foo->new;
+my $matches = eval { $foo->match(d => 'bar') };
+like($@, qr/^Foo has no method named d/,
+ "match dies when trying to match against a non-existent method");
+ok(!$matches,
+ "and it doesn't match");