Changelogging
[gitmo/Mouse.git] / t / 010_basics / 017_error_handling.t
CommitLineData
60ad2cb7 1#!/usr/bin/perl
fde8e43f 2# This is automatically generated by author/import-moose-test.pl.
3# DO NOT EDIT THIS FILE. ANY CHANGES WILL BE LOST!!!
4use t::lib::MooseCompat;
60ad2cb7 5
6use strict;
7use warnings;
8
fde8e43f 9use Test::More;
60ad2cb7 10use Test::Exception;
11
12# This tests the error handling in Mouse::Object only
13
14{
15 package Foo;
16 use Mouse;
17}
18
19throws_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';
21throws_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
24throws_ok { Foo->does() } qr/^\QYou must supply a role name to does()/,
25 'Cannot call does() without a role name';
fde8e43f 26
27done_testing;