Tidy whitespace
[gitmo/Moose.git] / t / 010_basics / 017_error_handling.t
CommitLineData
3ce51439 1#!/usr/bin/perl
2
3use strict;
4use warnings;
5
a28e50e4 6use Test::More;
be0ed157 7use Test::Fatal;
3ce51439 8
9# This tests the error handling in Moose::Object only
10
11{
12 package Foo;
13 use Moose;
14}
15
be0ed157 16like exception { Foo->new('bad') }, qr/^\QSingle parameters to new() must be a HASH ref/,
3ce51439 17 'A single non-hashref arg to a constructor throws an error';
be0ed157 18like exception { Foo->new(undef) }, qr/^\QSingle parameters to new() must be a HASH ref/,
a62dcd43 19 'A single non-hashref arg to a constructor throws an error';
3ce51439 20
be0ed157 21like exception { Foo->does() }, qr/^\QYou must supply a role name to does()/,
3ce51439 22 'Cannot call does() without a role name';
a28e50e4 23
24done_testing;