Jeremy Hageman wrote:
Scott thanks for the insight.
On Sep 1, 9:16 pm, Scott Taylor wrote:
Most mocks used in a rails project server neither of these purposes.
Primarily they are used for speed - which so far has been the primary
trade off with using a fixture replacement (such as FixtureReplacement,
FactoryGirl, etc).
As someone who sound like they rely heavily on a fixture replacement,
do you find you achieve the same level of isolation from dependencies
when setting up your tests?
As long as the (dependent) factory methods are generating valid objects
(they will raise as they use create! and save! internally if they
aren't), you should see exactly what you would from an invalid AR object.
I usually run one test file at a time, too, which helps with the error
count with dependencies, and only later when the class under test is
passing, I'll go and run the whole suite. Autotest does the same thing
if you don't like to do it manually.
Scott
_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users