Test semantics for raw_value
[gitmo/Moose.git] / t / 020_attributes / 001_attribute_reader_generation.t
index d6a4183..407633d 100644 (file)
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 14;
+use Test::More tests => 20;
 use Test::Exception;
 
 
@@ -59,6 +59,23 @@ use Test::Exception;
 }
 
 {
+    my $foo = Foo->new;
+    isa_ok($foo, 'Foo');
+
+    my $attr = $foo->meta->find_attribute_by_name("lazy_foo");
+
+    isa_ok( $attr, "Moose::Meta::Attribute" );
+
+    ok( $attr->is_lazy, "it's lazy" );
+
+    is( $attr->get_raw_value($foo), undef, "raw value" );
+
+    is( $attr->get_value($foo), 10, "lazy value" );
+
+    is( $attr->get_raw_value($foo), 10, "raw value" );
+}
+
+{
     my $foo = Foo->new(foo => 10, lazy_foo => 100);
     isa_ok($foo, 'Foo');