diff --git a/features/support/env.rb b/features/support/env.rb index 20cb4a1..11776e0 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -5,6 +5,14 @@ # Sets up the Rails environment for Cucumber ENV["RAILS_ENV"] ||= "cucumber" + +# Start/stop Solr +if not $cucumber_env_loaded + abort unless system 'rake solr:start' + at_exit { system 'rake solr:stop' } + $cucumber_env_loaded = true +end + require File.expand_path(File.dirname(__FILE__) + '/../../config/environment') require 'cucumber/rails/world' diff --git a/test/test_helper.rb b/test/test_helper.rb index 5b9b0f4..ac34778 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,10 +1,10 @@ ENV["RAILS_ENV"] = "test" # Start/stop Solr -if not $loaded +if not $test_helper_loaded abort unless system 'rake solr:start' at_exit { system 'rake solr:stop' } - $loaded = true + $test_helper_loaded = true end require File.expand_path(File.dirname(__FILE__) + "/../config/environment") -- libgit2 0.21.2