+++ /dev/null
-#!/usr/bin/perl
-
-use strict;
-use warnings;
-
-use Test::More tests => 1;
-
-BEGIN {
- use_ok('Moose');
-}
-
-1;
-
-__END__
-
-=pod
-
-I dont think I am going to keep this feature, but
-the tests are commented out for now.
-
-{
- package Foo;
- use Moose;
-
- sub greetings {
- "Hello, $_[1]";
- }
-
- method 'greet_world_from' => sub {
- my $from = shift;
- self->greetings("World") . " from $from";
- };
-
- method 'greet_world_from_me' => sub {
- self->greet_world_from("Stevan");
- };
-
- no Moose;
-}
-
-my $foo = Foo->new;
-isa_ok($foo, 'Foo');
-
-is($foo->greetings('World'), 'Hello, World', '... got the right value from greetings');
-is($foo->greet_world_from('Stevan'), 'Hello, World from Stevan', '... got the right value from greet_world_from');
-is($foo->greet_world_from_me, 'Hello, World from Stevan', '... got the right value from greet_world');
-
-=cut
\ No newline at end of file
use strict;
use warnings;
-use Test::More tests => 13;
+use Test::More tests => 10;
BEGIN {
use_ok('Moose');
override 'bark_once' => sub {
my $self = shift;
+ super();
return 'cow';
};
override 'bark_twice' => sub {
+ super();
return 'cowcow';
};
}
-TODO: {
- local $TODO = "method modifier isn't called if method id overridden";
+{
my $cow = Cow->new;
$cow->bark_once;
is( $Animal::BEFORE_BARK_COUNTER, 1,
{
- package Penguin;
- use Moose;
- extends 'Animal';
- our $AUGMENT_CALLED = 0;
-
- augment 'bark_once' => sub {
- my $self = shift;
- $self->dummy;
- inner();
- $self->dummy;
- };
-
- sub dummy {
- $AUGMENT_CALLED++;
- }
-}
-$Animal::BEFORE_BARK_COUNTER = 0;
-$Animal::AFTER_BARK_COUNTER = 0;
-my $penguin = Penguin->new;
-warn $penguin->bark_once;
-is( $Animal::BEFORE_BARK_COUNTER, 1,
- 'before modifier is called if augment is used' );
-is( $Animal::AFTER_BARK_COUNTER, 1,
- 'after modifier is called if augment is used' );
-TODO: {
- local $TODO = "The method modifier isn't called if the augment specified it";
- is( $Penguin::AUGMENT_CALLED, 2, 'augment is called' );
-}
-
-{
-
package MyDog;
use Moose;
our $BEFORE_BARK_COUNTER=0;