diff _test/Test/Class/Meta.pm @ 209:a8db61d0ed33

IMPL::Class::Meta refactoring
author cin
date Mon, 28 May 2012 19:58:56 +0400
parents 4d0e1962161c
children
line wrap: on
line diff
--- a/_test/Test/Class/Meta.pm	Fri May 18 18:43:00 2012 +0400
+++ b/_test/Test/Class/Meta.pm	Mon May 28 19:58:56 2012 +0400
@@ -5,42 +5,43 @@
 
 __PACKAGE__->PassThroughArgs;
 
-use IMPL::Test qw(test failed);
+use IMPL::Test qw(test failed assert);
 
 test defineFooClassData => sub {
-    Foo->class_data(info => {});    
+    Foo->static_accessor(info => {},'clone');    
 };
 
 test updateFooClassData => sub {
-    Foo->class_data('info')->{data} = 'Foo' ;
+    Foo->info->{data} = 'Foo' ;
 };
 
 test getFooClassData => sub {
-    failed "Wrong class data", "Expected: Foo", "Got: ".Foo->class_data('info')->{data}  unless Foo->class_data('info')->{data} eq 'Foo';
+    assert( Foo->info->{data} eq 'Foo' );
 };
 
 test getBazClassData => sub {
-    failed "Wrong class data", "Expected: Foo", "Got: ".Baz->class_data('info')->{data}  unless Baz->class_data('info')->{data} eq 'Foo';
+    assert( Baz->info->{data} eq 'Foo' );
+    assert( Bar->info->{data} eq 'Foo' );
 };
 
 test updateBarClassData => sub {
-    Bar->class_data('info')->{data} = 'Bar';
+    Bar->info->{data} = 'Bar';
 };
 
 test getBarClassData => sub {
-    failed "Wrong class data", "Expected: Bar", "Got: ".Bar->class_data('info')->{data}  unless Bar->class_data('info')->{data} eq 'Bar';
+    assert( Bar->info->{data} eq 'Bar');
 };
 
 test validatetFooClassData => sub {
-    failed "Wrong class data", "Expected: Foo", "Got: ".Foo->class_data('info')->{data}  unless Foo->class_data('info')->{data} eq 'Foo';
+    assert( Foo->info->{data} eq 'Foo');
 };
 
 test validateBazClassData => sub {
-    failed "Wrong class data", "Expected: Foo", "Got: ".Baz->class_data('info')->{data}  unless Baz->class_data('info')->{data} eq 'Foo';
+    assert( Baz->info->{data} eq 'Foo');
 };
 
 test getwrongBazClassData => sub {
-    failed "Wrong class data", "Expected: undef", "Got: ".Foo->class_data( 'info2' ) if Foo->class_data( 'info2' );
+    assert( not eval { Foo->info2; 1; } );
 };