Skip to content

Instantly share code, notes, and snippets.

@monken
Created July 17, 2010 11:30
Show Gist options
  • Save monken/479448 to your computer and use it in GitHub Desktop.
Save monken/479448 to your computer and use it in GitHub Desktop.
package Foo;
use Moose;
use Test::More;
has foo => ( is => 'rw', lazy => 1, predicate => 'has_foo', default => 1 );
my $foo = new Foo;
ok($foo->has_foo); # fail
ok($foo->meta->get_attribute('foo')->has_value($foo)); # fail
ok($foo->foo); # ok
ok($foo->has_foo); # ok
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment