Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
use 5.014;
use Test::Most;
{
package Foo;
use Moose;
has foo => qw( is ro );
sub bar { "made it to bar" }
sub baz { "made it to bar" }
before [qw(bar baz)] => sub { die "no foo" unless shift->foo }
}
note "foo is undefined";
{
my $foo = new_ok Foo => [];
dies_ok { $foo->bar } "\$foo->bar dies";
dies_ok { $foo->baz } "\$foo->baz dies";
}
note "foo is defined";
{
my $foo = new_ok Foo => [ foo => 1 ];
lives_ok { $foo->bar } "\$foo->bar lives";
lives_ok { $foo->baz } "\$foo->baz lives";
}
done_testing;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.