Skip to content

Instantly share code, notes, and snippets.

@osfameron
Created February 28, 2009 22:48
Show Gist options
  • Save osfameron/72140 to your computer and use it in GitHub Desktop.
Save osfameron/72140 to your computer and use it in GitHub Desktop.
use strict;
use warnings;
use Test::More tests => 3; # last test to print
use MooseX::Method::Signatures;
my $evalcode = do {
local $/ = undef;
<DATA>;
};
ok(
do {
my $r = eval $evalcode;
die $@ if not $r;
1;
},
'Basic Eval Moose'
);
my $foo = foo->new({});
is ($foo->example (), 1, 'First method declared');
is ($foo->example2(), 2, 'Second method declared (after injected semicolon)');
__DATA__
{
package foo;
use Moose;
use MooseX::Method::Signatures;
method example { 1 } # look Ma, no semicolon!
method example2 { 2 }
}
1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment