[rspec-users] Failing on rake but not on textmate (rails)

Rick DeNatale rick.denatale at gmail.com
Tue Jul 22 08:06:28 EDT 2008

On Mon, Jul 21, 2008 at 8:34 PM, Mark Wilden <mark.wilden at gmail.com> wrote:

> On Mon, Jul 21, 2008 at 4:33 PM, Macario Ortega <lists at ruby-forum.com>
> wrote:
>> I have a spec for a model that passes all tests if I run it using
>> textmate but I run rake some of the otherwise passed tests fail.
> AFAIK, the main difference is that rake copies the development db structure
> to the test db, whereas TextMate does not (and runs faster as a result). I
> don't know if that explains the behavior you're seeing.
>> I would like to use autotest but I can't trust the results.
> autotest also does not copy the database structure. I've been using it for
> six months and I've never noticed a problem with it. Why don't you trust it?
> I doubt that it's a problem with not copy the database structure from dev
to test. That sync's the db schema and would only be needed after a schema
change (i.e. one or more migrations have been run), and it would be much
more likely to cause a failure in Textmate when the code under test doesn't
see the expected db schema.

It's more likely that there are undeclared fixtures affecting the spec, a
spec which needs particular state in the database might succeed or not
depending on whether or not previous specs either left data behind, or
deleted data needed by the spec in question.

When I've seen cases where test/specs behaved differently when run
separately vs. being run in batch (e.g. by Rake) it's almost always because
I left out a fixture declaration.

Rick DeNatale

My blog on Ruby
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20080722/aa4c3955/attachment.html>

More information about the rspec-users mailing list