X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F20setuperrors.t;h=609581749a88907c48d815e8aec582ff8dec5693;hb=50841788d03e2342a00470eb2f458e717922615b;hp=5144f566bde6fdd67f28d983e6107123c9643d77;hpb=701da8c4d6f0b78ffc015085aa410a6cacfcdb40;p=dbsrgits%2FDBIx-Class.git diff --git a/t/20setuperrors.t b/t/20setuperrors.t index 5144f56..6095817 100644 --- a/t/20setuperrors.t +++ b/t/20setuperrors.t @@ -1,15 +1,24 @@ -#!/usr/bin/perl +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } -use Test::More tests => 1; +use warnings; +use strict; -eval { - package BuggyTable; - use base 'DBIx::Class'; +use Test::More; +use Test::Exception; - __PACKAGE__->load_components qw/Core/; - __PACKAGE__->table('buggy_table'); - __PACKAGE__->columns qw/this doesnt work as expected/; -}; -like($@,qr/\bcolumns\(\) is a read-only/, - "columns() error when apparently misused"); +use DBICTest; + +throws_ok ( + sub { + package BuggyTable; + use base 'DBIx::Class::Core'; + + __PACKAGE__->table('buggy_table'); + __PACKAGE__->columns( qw/this doesnt work as expected/ ); + }, + qr/\bcolumns\(\) is a read-only/, + 'columns() error when apparently misused', +); + +done_testing;