Subject: | Testing methods overridden in tested role is buggy |
I attached testing file, see it for details.
It returns "All tests successful." with version MooseX::Test::Role 0.03
but it fails with version MooseX::Test::Role 0.05
# Failed test 'MooseX::Test::Role appends data to output'
# at MockTest.t line 25.
# Structures begin differing at:
# $got->[2] = Does not exist
# $expected->[2] = 'suffix'
# Looks like you failed 1 test of 1.
Subject: | MockTest.t |
package TestRole::Appender;
use Moose::Role;
requires 'get_output';
around get_output => sub {
my ($super, $self) = @_;
return ($self->$super, 'suffix');
};
1;
package main;
use Test::Spec;
use MooseX::Test::Role;
describe "MooseX::Test::Role" => sub {
it "appends data to output" => sub {
my $consumer = consumer_of('TestRole::Appender',
get_output => sub { ('orig-A','orig-B') }
);
is_deeply(
[ $consumer->get_output() ],
[ 'orig-A', 'orig-B', 'suffix' ]
);
};
};
runtests;