summaryrefslogtreecommitdiffstats
path: root/t/102-missing.t
blob: 09f4bc685b610d2804e8fcd15ab76f5a5d8da91c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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");