X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F020_attributes%2F012_misc_attribute_tests.t;h=56bfe215df6c02001297fe69d7d083f1427da57b;hb=fde8e43f95fe996fbc2a778aa259feeb04552171;hp=ac46d5ab2848f2a7ae58e0d6faa14bd8e1871e88;hpb=db53d2b4ec887312eff701faa1749e983182e5d0;p=gitmo%2FMouse.git diff --git a/t/020_attributes/012_misc_attribute_tests.t b/t/020_attributes/012_misc_attribute_tests.t index ac46d5a..56bfe21 100644 --- a/t/020_attributes/012_misc_attribute_tests.t +++ b/t/020_attributes/012_misc_attribute_tests.t @@ -1,13 +1,15 @@ #!/usr/bin/perl +# This is automatically generated by author/import-moose-test.pl. +# DO NOT EDIT THIS FILE. ANY CHANGES WILL BE LOST!!! +use t::lib::MooseCompat; use strict; use warnings; -use Test::More tests => 43; +use Test::More; +$TODO = q{Mouse is not yet completed}; use Test::Exception; -use lib 't/lib'; -use Test::Mouse; { { @@ -65,7 +67,7 @@ use Test::Mouse; lives_ok { $test->good_lazy_attr; - } '... this does work'; + } '... this does not work'; } { @@ -142,7 +144,7 @@ use Test::Mouse; throws_ok { $moose_obj->a_str( $moose_obj ) - } qr/Attribute \(a_str\) does not pass the type constraint because\: Validation failed for 'Str' failed with value OverloadedStr=HASH\(0x.+?\)/, + } qr/Attribute \(a_str\) does not pass the type constraint because\: Validation failed for 'Str' with value OverloadedStr=HASH\(0x.+?\)/, '... dies without overloading the string'; } @@ -157,7 +159,7 @@ use Test::Mouse; throws_ok { OverloadBreaker->new; - } qr/Attribute \(a_num\) does not pass the type constraint because\: Validation failed for 'Int' failed with value 7\.5/, + } qr/Attribute \(a_num\) does not pass the type constraint because\: Validation failed for 'Int' with value 7\.5/, '... this doesnt trip overload to break anymore '; lives_ok { @@ -246,9 +248,8 @@ use Test::Mouse; ok(!$instance->_has_foo, "noo _foo value yet"); is($instance->foo, 'works', "foo builder works"); is($instance->_foo, 'works too', "foo builder works too"); - dies_ok { $instance->fool } -# throws_ok { $instance->fool } -# qr/Test::LazyBuild::Attribute does not support builder method \'_build_fool\' for attribute \'fool\'/, + throws_ok { $instance->fool } + qr/Test::LazyBuild::Attribute does not support builder method \'_build_fool\' for attribute \'fool\'/, "Correct error when a builder method is not present"; } @@ -259,12 +260,11 @@ use Test::Mouse; use Mouse; } -# Mouse::Exporter does not support 'with_meta' -#lives_ok { OutOfClassTest::has('foo', is => 'bare'); } 'create attr via direct sub call'; -#lives_ok { OutOfClassTest->can('has')->('bar', is => 'bare'); } 'create attr via can'; +lives_ok { OutOfClassTest::has('foo', is => 'bare'); } 'create attr via direct sub call'; +lives_ok { OutOfClassTest->can('has')->('bar', is => 'bare'); } 'create attr via can'; -#ok(OutOfClassTest->meta->get_attribute('foo'), 'attr created from sub call'); -#ok(OutOfClassTest->meta->get_attribute('bar'), 'attr created from can'); +ok(OutOfClassTest->meta->get_attribute('foo'), 'attr created from sub call'); +ok(OutOfClassTest->meta->get_attribute('bar'), 'attr created from can'); { @@ -277,3 +277,5 @@ use Test::Mouse; } } + +done_testing;