[rspec-users] Foreign key constraints, fixtures, and rake task
lists-rspec at shopwatch.org
Mon Aug 27 10:51:16 EDT 2007
Tilmann Singer wrote:
> * Jay Levitt <lists-rspec at shopwatch.org> [20070827 03:51]:
>> What's rake doing differently?
> rake spec isn't doing anything fundamentally different, but the order
> the specs are run is propably randomly different from when you run
> them with spec so they happen to pass in one case and fail in the
Nope, it's definitely not random - script/spec works every time, rake
fails every time.
I'm not actually using :accounts at all in my specs; it's only
referenced in the database constraints. (It's tested in Test::Unit at
the moment.) So the order wouldn't matter.
I'm sure I can work around it by loading all the fixtures in some order
that makes the database happy; I'm more curious as to why it happens
with "rake spec", and not with (what seems to be) the equivalent
Unfortunately, test.log doesn't show me anything that happens during the
failed rake run. I'll have to see if there's a way to turn up logging
on MySQL itself to see what's different, or maybe switch to a TCP socket
and use Wireshark (nee Ethereal).
More information about the rspec-users