X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fno_replace_existing_symbols.t;h=a5867ec331829730e3ac8cbd3e93a50c1e7f95f5;hb=d4e8b9b22a23ed4d6adcda7f1a82d28ab9e2bce2;hp=e59da3add45a2717828402ed7064c054d526911a;hpb=3f137d21445c652a26d7ef962c272ff76c7413b5;p=gitmo%2FMooseX-Emulate-Class-Accessor-Fast.git diff --git a/t/no_replace_existing_symbols.t b/t/no_replace_existing_symbols.t index e59da3a..a5867ec 100644 --- a/t/no_replace_existing_symbols.t +++ b/t/no_replace_existing_symbols.t @@ -1,12 +1,16 @@ +#!/usr/binperl -w + +use strict; +use warnings; +use Test::More tests => 6; + { package SomeClass; - #use base qw/Class::Accessor::Fast/; use Moose; with 'MooseX::Emulate::Class::Accessor::Fast'; - + sub anaccessor { 'wibble' } - #sub new { bless {}, 'SomeClass' } } { package SubClass; @@ -16,19 +20,17 @@ __PACKAGE__->mk_accessors(qw/ anaccessor anotherone /); } -use Test::More tests => 6; - # 1, 2 my $someclass = SomeClass->new; -is $someclass->anaccessor, 'wibble'; +is($someclass->anaccessor, 'wibble'); $someclass->anaccessor('fnord'); -is $someclass->anaccessor, 'wibble'; +is($someclass->anaccessor, 'wibble'); # 3-6 my $subclass = SubClass->new; -is $subclass->anaccessor, 'wibble'; +ok( not defined $subclass->anaccessor ); $subclass->anaccessor('fnord'); -is $subclass->anaccessor, 'wibble'; -is $subclass->anotherone, 'flibble'; +is($subclass->anaccessor, 'fnord'); +is($subclass->anotherone, 'flibble'); $subclass->anotherone('fnord'); -is $subclass->anotherone, 'flibble'; +is($subclass->anotherone, 'flibble');