[rspec-users] modules and stub

Sarah Allen
Mon, 25 May 2009 04:03:21 -0000

David Chelimsky wrote:
> Stub methods on objects, not modules. The method can be one that
> *comes from* a module, but you need to stub it on the specific object
> that is at play in the example.

That makes sense, except the code does this:
 Foo::Bar::do_something(path)

I''m not an expert with modules, but that looks like it is calling the
method directly on the module without an object.  Is there any way for
me to stub that?  or is that not a good thing to be doing?

Thanks,