Commit 2e18fad81995a02d28e3a3b3e0cfe60839d98330
1 parent
9b251ccc
Exists in
master
and in
28 other branches
Fix to start/stop Solr with cucumber
Showing
2 changed files
with
10 additions
and
2 deletions
Show diff stats
features/support/env.rb
@@ -5,6 +5,14 @@ | @@ -5,6 +5,14 @@ | ||
5 | 5 | ||
6 | # Sets up the Rails environment for Cucumber | 6 | # Sets up the Rails environment for Cucumber |
7 | ENV["RAILS_ENV"] ||= "cucumber" | 7 | ENV["RAILS_ENV"] ||= "cucumber" |
8 | + | ||
9 | +# Start/stop Solr | ||
10 | +if not $cucumber_env_loaded | ||
11 | + abort unless system 'rake solr:start' | ||
12 | + at_exit { system 'rake solr:stop' } | ||
13 | + $cucumber_env_loaded = true | ||
14 | +end | ||
15 | + | ||
8 | require File.expand_path(File.dirname(__FILE__) + '/../../config/environment') | 16 | require File.expand_path(File.dirname(__FILE__) + '/../../config/environment') |
9 | require 'cucumber/rails/world' | 17 | require 'cucumber/rails/world' |
10 | 18 |
test/test_helper.rb
1 | ENV["RAILS_ENV"] = "test" | 1 | ENV["RAILS_ENV"] = "test" |
2 | 2 | ||
3 | # Start/stop Solr | 3 | # Start/stop Solr |
4 | -if not $loaded | 4 | +if not $test_helper_loaded |
5 | abort unless system 'rake solr:start' | 5 | abort unless system 'rake solr:start' |
6 | at_exit { system 'rake solr:stop' } | 6 | at_exit { system 'rake solr:stop' } |
7 | - $loaded = true | 7 | + $test_helper_loaded = true |
8 | end | 8 | end |
9 | 9 | ||
10 | require File.expand_path(File.dirname(__FILE__) + "/../config/environment") | 10 | require File.expand_path(File.dirname(__FILE__) + "/../config/environment") |