allow isa => SomeRandomClass in +foo attr declarations
[gitmo/Moose.git] / t / 010_basics / 010_method_keyword.t
CommitLineData
3279ab4a 1#!/usr/bin/perl
2
3use strict;
4use warnings;
5
2a0f3bd3 6use Test::More tests => 1;
3279ab4a 7
8BEGIN {
9 use_ok('Moose');
10}
11
2a0f3bd3 121;
13
14__END__
15
16=pod
17
18I dont think I am going to keep this feature, but
19the tests are commented out for now.
20
3279ab4a 21{
22 package Foo;
23 use Moose;
24
25 sub greetings {
26 "Hello, $_[1]";
27 }
28
29 method 'greet_world_from' => sub {
30 my $from = shift;
31 self->greetings("World") . " from $from";
32 };
33
34 method 'greet_world_from_me' => sub {
35 self->greet_world_from("Stevan");
36 };
37
38 no Moose;
39}
40
41my $foo = Foo->new;
42isa_ok($foo, 'Foo');
43
44is($foo->greetings('World'), 'Hello, World', '... got the right value from greetings');
45is($foo->greet_world_from('Stevan'), 'Hello, World from Stevan', '... got the right value from greet_world_from');
2a0f3bd3 46is($foo->greet_world_from_me, 'Hello, World from Stevan', '... got the right value from greet_world');
47
48=cut