0b6cb88ec3e30eaa4f8845dcfadcbc45e9930836
[gitmo/Mouse.git] / t / 010_basics / 017_error_handling.t
1 #!/usr/bin/perl
2 # This is automatically generated by author/import-moose-test.pl.
3 # DO NOT EDIT THIS FILE. ANY CHANGES WILL BE LOST!!!
4 use t::lib::MooseCompat;
5
6 use strict;
7 use warnings;
8
9 use Test::More;
10 use Test::Exception;
11
12 # This tests the error handling in Mouse::Object only
13
14 {
15     package Foo;
16     use Mouse;
17 }
18
19 throws_ok { Foo->new('bad') } qr/^\QSingle parameters to new() must be a HASH ref/,
20           'A single non-hashref arg to a constructor throws an error';
21 throws_ok { Foo->new(undef) } qr/^\QSingle parameters to new() must be a HASH ref/,
22           'A single non-hashref arg to a constructor throws an error';
23
24 throws_ok { Foo->does() } qr/^\QYou must supply a role name to does()/,
25           'Cannot call does() without a role name';
26
27 done_testing;