10 use Sub::Exporter -setup => {
16 $INC{'ExportsFoo.pm'} = 1;
36 # The grossness near the end of the regex works around a bug with \Q not
37 # escaping \& properly with perl 5.8.x
39 ::exception { with 'Foo' },
40 qr/^\Q'Foo' requires the method 'foo' to be implemented by 'Class'. If you imported functions intending to use them as methods, you need to explicitly mark them as such, via Class->meta->add_method(foo => \E\\\&foo\)/,
41 "imported 'method' isn't seen"
43 Class->meta->add_method(foo => \&foo);
45 ::exception { with 'Foo' },
51 ::exception { with 'Bar' },
52 qr/^\Q'Bar' requires the method 'bar' to be implemented by 'Class' at/,
53 "requirement isn't imported, so don't give the extra info in the error"
57 does_ok('Class', 'Foo');