From aec41bcce08ca01a30d528cd0fc1ebcaf0570565 Mon Sep 17 00:00:00 2001 From: Michael Grosser Date: Thu, 3 Dec 2015 08:35:18 -0800 Subject: [PATCH] allow spring to be force enabled --- Readme.md | 1 + lib/parallel_tests/cli.rb | 2 +- spec/integration_spec.rb | 6 ++++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Readme.md b/Readme.md index 75e989ef..e2ec7784 100644 --- a/Readme.md +++ b/Readme.md @@ -246,6 +246,7 @@ TIPS - [Distributed parallel test (e.g. Travis Support)](https://github.com/grosser/parallel_tests/wiki/Distributed-Parallel-Tests-and-Travis-Support) - Debug errors that only happen with multiple files using `--verbose` and [cleanser](https://github.com/grosser/cleanser) - Shell alias: `alias prspec='parallel_rspec -m 2 --'` + - [Spring] to use spring you have to [patch it](https://github.com/grosser/parallel_tests/wiki) - Contribute your own gotaches to the [Wiki](https://github.com/grosser/parallel_tests/wiki) or even better open a PR :) TODO diff --git a/lib/parallel_tests/cli.rb b/lib/parallel_tests/cli.rb index 37d5c488..aefef785 100644 --- a/lib/parallel_tests/cli.rb +++ b/lib/parallel_tests/cli.rb @@ -8,7 +8,7 @@ class CLI def run(argv) options = parse_options!(argv) - ENV['DISABLE_SPRING']='1' + ENV['DISABLE_SPRING'] ||= '1' num_processes = ParallelTests.determine_number_of_processes(options[:count]) num_processes = num_processes * (options[:multiply] || 1) diff --git a/spec/integration_spec.rb b/spec/integration_spec.rb index 0dcf04e7..40eb4551 100644 --- a/spec/integration_spec.rb +++ b/spec/integration_spec.rb @@ -208,6 +208,12 @@ def test_unicode expect(result).to include "SPRING: 1" end + it "can enable spring" do + write "spec/xxx_spec.rb", 'puts "SPRING: #{ENV["DISABLE_SPRING"]}"' + result = run_tests("spec", processes: 2, type: 'rspec', export: "DISABLE_SPRING=0") + expect(result).to include "SPRING: 0" + end + it "runs with files that have spaces" do write "test/xxx _test.rb", 'puts "YES"' result = run_tests("test", processes: 2, type: 'test')