Skip Menu |

This queue is for tickets about the Test-MockObject CPAN distribution.

Report information
The Basics
Id: 73556
Status: open
Priority: 1/
Queue: Test-MockObject

People
Owner: Nobody in particular
Requestors: dolmen [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.20110612
Fixed in: (no value)



Subject: T::MO::Extends->mock should duplicate prototype
Test::MockObject::Extends->mock wraps the given sub with another sub. However that wrapper currently has only an undefined prototype. This raises a warning (Prototype mismatch) when the original method had a different prototype. So T:MO::E::mock should instead: - copy the prototype of the given sub to the wrapper using Sub::Prototype - check for mismatch between the given sub and the overwritten sub (to help the T:MO user to diagnose the problem) (of course, I know that using prototypes on object methods is usually useless) -- Olivier Mengué - http://perlresume.org/DOLMEN
attributes such as 'lvalue' must be duplicated too, or an exception must be raised if that is not possible. -- Olivier Mengué - http://perlresume.org/DOLMEN
The bug was hard to reproduce: the 'Prototype mismatch' warning is raised only if the mocked method has been called at least once before the mock. This can happen in previous tests or in the object constructor itself. A clean test case is in developement. -- Olivier Mengué - http://perlresume.org/DOLMEN
Subject: [PATCH] T::MO::Extends->mock should duplicate prototype
Le 2011-12-30 12:10:31, DOLMEN a écrit : Show quoted text
Chromatic, Could you review this patch? Regards, Olivier.