Wed Feb 11 06:42:30 2009Kalle.Hallivuori [...] ascom.com - Ticket created
Subject:
Mock inherited methods as well by default
Date:
Wed, 11 Feb 2009 13:48:56 +0200
To:
bug-test-callflow [...] rt.cpan.org
From:
Kalle Hallivuori <Kalle.Hallivuori [...] ascom.com>
Problem:
package Foo;
sub foo { die "called a real method" }
package Bar;
use base 'Foo';
package main;
my $mocked = mock_object( 'Bar' );
$mocked->foo(); # dies though shouldn't
Solution:
- add property 'mock_heritage' => 1
- when 'mock_heritage', recursively collect subs from @ISA in
mock_package.