From 2e18fad81995a02d28e3a3b3e0cfe60839d98330 Mon Sep 17 00:00:00 2001 From: Rafael Martins Date: Sun, 15 Apr 2012 22:50:54 -0300 Subject: [PATCH] Fix to start/stop Solr with cucumber --- features/support/env.rb | 8 ++++++++ test/test_helper.rb | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) 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