Test spies

I’m curious what the current state of test spies in rspec is?

What is everyone using for this? not a mock? rr? rspec-spies?

I see that spies were going to be added to rspec 1.3.0, but pulled
because of a bug
(Lighthouse - Beautifully Simple Issue Tracking), will this
be brought back in? I really like the rspec standard mock / stub
syntax and am hesitant to move to another solution.

Best,
Michael G.

On Apr 12, 2010, at 11:17 AM, Michael G. wrote:

I’m curious what the current state of test spies in rspec is?

What is everyone using for this? not a mock? rr? rspec-spies?
I see that spies were going to be added to rspec 1.3.0, but pulled
because of a bug
(Lighthouse - Beautifully Simple Issue Tracking), will this
be brought back in? I really like the rspec standard mock / stub
syntax and am hesitant to move to another solution.

Not-a-mock works. Any reason not to just use that?

On Mon, Apr 12, 2010 at 1:16 PM, David C. [email protected]
wrote:

Not-a-mock works. Any reason not to just use that?

Mostly because I like the default rspec stub / mock syntax. Adding
not-a-mock replaces the entire mock framework:

config.mock_with NotAMock::RspecMockFrameworkAdapter

doing so causes all of my existing specs to break. It seemed like the
built-in rspec solution did not require changing all of my existing
mocks/stubs.

Best,
Michael G.

On Apr 12, 2010, at 2:38 PM, Michael G. wrote:

syntax and am hesitant to move to another solution.
built-in rspec solution did not require changing all of my existing
mocks/stubs.

Sounds like not-a-mock is broken then, which is no surprise since
rspec’s mocks don’t really offer any extension APIs. It must have broken
after internal changes in rspec-mocks.

Per the lighthouse ticket, the addition of have_received raised new
questions about sync’ing the should_receive and have_received APIs. I
think that a fair sum of refactoring would be required to do this
properly. This is very low on a very long list of priorities right now,
so my recommendation is to fix not-a-mock to work with the latest rspec.

HTH,
David