Test lazy default for String trait
Dave Rolsky [Sat, 25 Sep 2010 18:54:25 +0000 (13:54 -0500)]
t/070_native_traits/005_trait_string.t

index f76783e..ebd2063 100644 (file)
@@ -263,6 +263,17 @@ sub run_tests {
             $obj->_string, 'song long string',
             'substr_curried_3 as setter'
         );
+
+        if ( $class->meta->get_attribute('_string')->is_lazy ) {
+            my $obj = $class->new;
+
+            $obj->append('foo');
+
+            is(
+                $obj->_string, 'foo',
+                'append with lazy default'
+            );
+        }
     }
     $class;
 }