stevieb9 / mock-sub

Mock subroutines, with ability to add return values and side effects.
4 stars 0 forks source link

scalar returns from the mock #6

Closed jberger closed 8 years ago

jberger commented 8 years ago

Currently side_effect and return_value can only return a scalar, but in there may be times when a mocked method has to return multiple values. Yes, this presents a storage problem, but it seems like an idea to be considered. (I'll try to have a think on it myself).

stevieb9 commented 8 years ago

Fixed in b69f715. Note that the internal implementation is very likely to change. I'm not very comfortable with how I've done it. Leaving open so I revisit soon.

Note also that for now, return_value parameter can only accept a single scalar... only the return_value() method can accept a list of return values. Also note that both side_effect and return_value now return undef as opposed to an empty string when they aren't defined.