sporkrb / spork-testunit

Test::Unit support for Spork
67 stars 27 forks source link

Documentation suggestion #25

Closed dtsadok closed 13 years ago

dtsadok commented 13 years ago

require 'test_helper' unless defined?(Spork) seems to work better than: require 'test_helper' unless Spork.using_spork? since the latter will fail if Spork is not used and test_helper is not included :-)

timcharper commented 13 years ago

Spork may be defined but not used (ie: spork server isn't running). In either case it will be defined. Not sure if I understand you clearly, but if you understand me, do you still feel the docs should be changed? On Oct 4, 2011 6:13 PM, "Daniel T" < reply@reply.github.com> wrote:

require 'test_helper' unless defined?(Spork) seems to work better than: require 'test_helper' unless Spork.using_spork? since the latter will fail if Spork is not used and test_helper is not included :-)

Reply to this email directly or view it on GitHub: https://github.com/timcharper/spork-testunit/issues/25

dtsadok commented 13 years ago

Thanks for the fast response. I should point out that I'm using Rails 2.3.14 (with Bundler), so that may be a factor.

Anyway, Spork was not defined for that line when I ran a regular rake test:unit without Spork, until require 'spork' was encountered inside test_helper.rb (after the unless was evaluated). In my case, changing the condition to defined? did the trick.

Great lib, by the way. Thanks again.