From cd7d32b1e63812887174e90a356a4e307c1337c0 Mon Sep 17 00:00:00 2001 From: Rich Healey Date: Tue, 5 Jun 2012 19:47:00 +1000 Subject: [PATCH 1/2] Amend test to not collide with travis --- spec/guard/jasmine/cli_spec.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/spec/guard/jasmine/cli_spec.rb b/spec/guard/jasmine/cli_spec.rb index e345b0c..679e479 100644 --- a/spec/guard/jasmine/cli_spec.rb +++ b/spec/guard/jasmine/cli_spec.rb @@ -68,10 +68,11 @@ end it 'respects the RAILS_ENV environment variable' do - ENV['RAILS_ENV'] = "test" - runner.should_receive(:run).with(anything(), hash_including(:server_env => 'test')).and_return [true, []] + old_env = ENV['RAILS_ENV'] + ENV['RAILS_ENV'] = "some_arbitrary_environment" + runner.should_receive(:run).with(anything(), hash_including(:server_env => 'some_arbitrary_environment')).and_return [true, []] cli.start(['spec']) - ENV['RAILS_ENV'] = nil + ENV['RAILS_ENV'] = old_env end context 'for a valid console option' do From ae904a774f800ca70902726c1773f64f1fe7da56 Mon Sep 17 00:00:00 2001 From: Rich Healey Date: Wed, 6 Jun 2012 10:16:32 +1000 Subject: [PATCH 2/2] Fix support for CLI invocations and RAILS_ENV --- lib/guard/jasmine/cli.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/guard/jasmine/cli.rb b/lib/guard/jasmine/cli.rb index d647fb8..1d83e19 100644 --- a/lib/guard/jasmine/cli.rb +++ b/lib/guard/jasmine/cli.rb @@ -88,7 +88,7 @@ def spec(*paths) runner[:phantomjs_bin] = options.bin || CLI.which('phantomjs') runner[:timeout] = options.timeout runner[:port] = options.port - runner[:server_env] = options.server_env + runner[:server_env] = ENV['RAILS_ENV'] || options.server_env runner[:spec_dir] = options.spec_dir runner[:console] = [:always, :never, :failure].include?(options.console.to_sym) ? options.console.to_sym : :failure runner[:errors] = [:always, :never, :failure].include?(options.errors.to_sym) ? options.errors.to_sym : :failure