David Chelimsky wrote:
On Sat, Nov 21, 2009 at 12:28 AM, Elliot Winkler
<elliot.wink...@gmail.com <mailto:elliot.wink...@gmail.com>> wrote:
I'm having the hardest time trying to figure out something weird
I've suddenly run into. So I'm using Spork to run my specs.
Naturally I've got TM_RSPEC_OPTS in Textmate set to --drb and I'm
running `spork` from the command line to fire up the Spork server.
However, if I have a spec file open in Textmate and I press
Command-R, then the specs in the file get executed twice. I did a
quick test by having spec_helper print out something at the bottom
of the file and then wrote up a quick one-example spec file. When
I ran it, I saw the spinner spin, the debug line got printed to
the window, the output from the specs appeared, and then the
spinner spun some more and the debug line appeared again (but a
duplicate set of specs didn't appear because I think RSpec's smart
about not re-running tests). So it definitely looks like
spec_helper is getting loaded again, after all the specs are run.
(I know spec_helper should be run twice, once during preloading,
once during execution. But not again, AFTER execution.)
At first I thought it might be only specific to my project, but I
tried creating a fresh Rails project, installing RSpec into it,
and creating and running a quick spec file, but the same thing
happened -- spec_helper seems to get loaded again. I also tried
wiping and reinstalling the rspec, rspec-rails, and spork gems,
but that didn't work either.
Just to emphasize, this is only when Spork is running. If I leave
TM_RSPEC_OPTS at --drb but fail to leave the Spork server open,
the specs only get run once as they should.
Also, this is only for Textmate -- I've got --drb in my spec.opts
and `rake spec` works just fine when Spork is running.
So I really don't know who the culprit is: Spork, RSpec bundle, or
maybe it's just me. I noticed in Lighthouse a few people have had
this same problem, but those were a while back and anyway this
seems to be different.
David, can you think of a reason why something like this would be
happening? Exit status maybe? Or maybe this is more of a Spork
question.
Sounds like a spork question to me :) I was able to duplicate your
experience, but I don't have any initial thoughts about why this would
be happening.
Hmm.. I can't think of why this would happen either. Tim Harper is a
textmate user so if you post this question to the spork mailing list he
could probably help you. (Spork ML:
http://groups.google.com/group/sporkgem)
-Ben
_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users