Commit | Line | Data |
3279ab4a |
1 | #!/usr/bin/perl |
2 | |
3 | use strict; |
4 | use warnings; |
5 | |
2a0f3bd3 |
6 | use Test::More tests => 1; |
3279ab4a |
7 | |
8 | BEGIN { |
9 | use_ok('Moose'); |
10 | } |
11 | |
2a0f3bd3 |
12 | 1; |
13 | |
14 | __END__ |
15 | |
16 | =pod |
17 | |
18 | I dont think I am going to keep this feature, but |
19 | the 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 | |
41 | my $foo = Foo->new; |
42 | isa_ok($foo, 'Foo'); |
43 | |
44 | is($foo->greetings('World'), 'Hello, World', '... got the right value from greetings'); |
45 | is($foo->greet_world_from('Stevan'), 'Hello, World from Stevan', '... got the right value from greet_world_from'); |
2a0f3bd3 |
46 | is($foo->greet_world_from_me, 'Hello, World from Stevan', '... got the right value from greet_world'); |
47 | |
48 | =cut |