X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F020_attribute.t;h=cad88e2f516090f2715729de7794a94a60c921e0;hb=47d35fbafc21dc6ede2024c81bbb6504e3cb27ae;hp=30bb9cdf0a755eb7c364db9c778455101bcc1c55;hpb=3d4db6ecaa27ef648b9278368e8e85cfd61257f4;p=gitmo%2FClass-MOP.git diff --git a/t/020_attribute.t b/t/020_attribute.t index 30bb9cd..cad88e2 100644 --- a/t/020_attribute.t +++ b/t/020_attribute.t @@ -1,11 +1,9 @@ -#!/usr/bin/perl - use strict; use warnings; use Scalar::Util 'reftype', 'blessed'; -use Test::More tests => 104; +use Test::More tests => 100; use Test::Exception; use Class::MOP; @@ -227,25 +225,3 @@ dies_ok { Class::MOP::Attribute->name } q{... can't call name() as a class metho is($attr->builder, 'foo_builder', '... $attr->builder == foo_builder'); } - -{ - for my $value ({}, bless({}, 'Foo')) { - throws_ok { - Class::MOP::Attribute->new('$foo', default => $value); - } qr/References are not allowed as default values/; - } -} - -{ - { - package Method; - use overload '&{}' => sub { sub { $_[0] } }; - } - - my $attr; - lives_ok { - $attr = Class::MOP::Attribute->new('$foo', default => bless({}, 'Method')); - } 'objects with overloaded codification accepted as default'; - - is($attr->default(42), 42, 'default calculated correctly with overloaded object'); -}