Yep. And w.r.t. empty objects, make sure new("MyClass") works and
returns a valid object. This should produce an "empty" object.
Note that the explicit constructor function should be named as the
class itself (e.g. MyClass()). It's up to you to decide whether
it should support being called with n
I agree with Kasper. You are better off just leaving initialize() to
its default implementation. Violating that abstraction for the purpose
of testing is only going to put your software more at risk, defeating
the purpose of testing.
Overriding initialize() makes it do more than just set slots, bu
Ok, this is answering a different question, but the recommendation is to
avoid spending time on the initialize method and instead write am explicit
constructor function.
On Thu, Sep 28, 2017 at 10:48 AM, Zach Skidmore wrote:
> Hi All,
>
> I maintain the GenVisR package and am currently convertin
Hi All,
I maintain the GenVisR package and am currently converting it to S4 classes.
I'm running into a problem however when writing unit tests for functions within
the initalizer. What I really need is a "mock" object of the class for which
the initializer unit tests are being performed but wh