use strict;
use warnings;
-use Test::More tests => 15;
-use Test::Exception;
-
+use Test::More;
+use Test::Fatal;
{
}
#Yeah.. this doesn't work like this anymore, see below. (groditi)
-#throws_ok {
+#like exception {
# Foo->new(bar => 10, baz => undef);
-#} qr/^Attribute \(baz\) is required and cannot be undef/, '... must supply all the required attribute';
+#}, qr/^Attribute \(baz\) is required and cannot be undef/, '... must supply all the required attribute';
-#throws_ok {
+#like exception {
# Foo->new(bar => 10, boo => undef);
-#} qr/^Attribute \(boo\) is required and cannot be undef/, '... must supply all the required attribute';
+#}, qr/^Attribute \(boo\) is required and cannot be undef/, '... must supply all the required attribute';
-lives_ok {
+ok ! exception {
Foo->new(bar => 10, baz => undef);
-} '... undef is a valid attribute value';
+}, '... undef is a valid attribute value';
-lives_ok {
+ok ! exception {
Foo->new(bar => 10, boo => undef);
-} '... undef is a valid attribute value';
+}, '... undef is a valid attribute value';
-throws_ok {
+like exception {
Foo->new;
-} qr/^Attribute \(bar\) is required/, '... must supply all the required attribute';
+}, qr/^Attribute \(bar\) is required/, '... must supply all the required attribute';
+done_testing;