moving some tests around, increasing the coverage and generally improving the test...
[gitmo/Class-MOP.git] / t / 030_method.t
CommitLineData
cbd9f942 1#!/usr/bin/perl
2
3use strict;
4use warnings;
5
aa448b16 6use Test::More tests => 8;
cbd9f942 7use Test::Exception;
8
9BEGIN {
727919c5 10 use_ok('Class::MOP');
cbd9f942 11 use_ok('Class::MOP::Method');
12}
13
14my $meta = Class::MOP::Method->meta;
15isa_ok($meta, 'Class::MOP::Class');
16
17
18{
19 my $meta = Class::MOP::Method->meta();
20 isa_ok($meta, 'Class::MOP::Class');
21
22 foreach my $method_name (qw(
cbd9f942 23 wrap
24 )) {
25 ok($meta->has_method($method_name), '... Class::MOP::Method->has_method(' . $method_name . ')');
26 }
27}
28
29dies_ok {
30 Class::MOP::Method->wrap()
31} '... bad args for &wrap';
32
33dies_ok {
34 Class::MOP::Method->wrap('Fail')
35} '... bad args for &wrap';
36
37dies_ok {
38 Class::MOP::Method->wrap([])
39} '... bad args for &wrap';