freerange/sauron — pull request #19 by floehopper (2012-04-02 17:39:46+00:00)
Title: Expectation is too strict.

- I think this test overly constrains the implementation. The
expectation requires `Record.all` is invoked *exactly* once with the
specified parameters.
- Using the "expect commands, stub queries" heuristic [1], I reckon it's
better to stub in this case.
- A more perplexing issue is that at this point we are "mocking code we
don't own" [2]. I wonder whether we might be better off using the real
ActiveRecord implementation. We could always use an in-memory db if
we're worried about performance.

[1] http://www.jmock.org/yoga.html "Stubs and Expectations"
[2]
http://www.mockobjects.com/2007/04/test-smell-everything-is-mocked.html
"Don't mock third-party libraries"