Gah, kill use_ok and prototypes.
[gitmo/Class-MOP.git] / t / 023_attribute_get_read_write.t
index 0b490bb..cc08a5f 100644 (file)
@@ -1,15 +1,11 @@
-#!/usr/bin/perl
-
 use strict;
 use warnings;
 
 use Scalar::Util 'blessed', 'reftype';
 
-use Test::More tests => 38;
+use Test::More tests => 36;
 
-BEGIN {
-    use_ok('Class::MOP');
-}
+use Class::MOP;
 
 =pod
 
@@ -108,31 +104,9 @@ ok(!$gorch_attr->get_write_method, '... $attr does not have an write method');
     my $writer = $gorch_attr->get_write_method_ref;        
     
     isa_ok($reader, 'Class::MOP::Method');
-    ok(!blessed($writer), '... it is not a plain old sub'); 
+    ok(blessed($writer), '... it is not a plain old sub'); 
+    isa_ok($writer, 'Class::MOP::Method');    
     
     is($reader->fully_qualified_name, 'Foo::get_gorch', '... it is the sub we are looking for');
+    is($writer->fully_qualified_name, 'Foo::__ANON__', '... it is the sub we are looking for');    
 }
-
-my $foo = bless {}, 'Foo';
-$foo->set_bar(1);
-$foo->baz(10);
-
-is_deeply($foo->meta->get_meta_instance->get_all_slot_values($foo), {
-    bar => 1,
-    baz => 10,
-});
-
-my $bar = bless {}, 'Bar';
-$bar->set_bar(99);
-
-is_deeply($bar->meta->get_meta_instance->get_all_slot_values($bar), {
-    bar => 99,
-});
-
-$bar->quux(1337);
-
-is_deeply($bar->meta->get_meta_instance->get_all_slot_values($bar), {
-    bar  => 99,
-    quux => 1337,
-});
-