Skip to content

Commit

Permalink
Do not output a failing runner html on startup. (See #112)
Browse files Browse the repository at this point in the history
The Rails error page is too large to print to the console, just
show a message that more diagnosis information is available
at the runner url, which was printed to the console one line above.
  • Loading branch information
netzpirat committed Feb 19, 2013
1 parent 5fb7e2f commit 6d337ad
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
6 changes: 4 additions & 2 deletions lib/guard/jasmine/util.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ def runner_available?(options)
available = response.code.to_i == 200

unless available
::Guard::Jasmine::Formatter.error "Jasmine test runner fails with response code #{ response.code }"
::Guard::Jasmine::Formatter.error(response.body) if response.body
::Guard::Jasmine::Formatter.error "Jasmine test runner failed with status #{ response.code }"
if response.body
::Guard::Jasmine::Formatter.error 'Please open the Jasmine runner in your browser for more information.'
end
end

available
Expand Down
10 changes: 5 additions & 5 deletions spec/guard/jasmine/util_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
end

it 'does show that the runner is available' do
Guard::Jasmine::Formatter.should_receive(:info).with "Waiting for Jasmine test runner at http://localhost:8888/jasmine"
Guard::Jasmine::Formatter.should_receive(:info).with 'Waiting for Jasmine test runner at http://localhost:8888/jasmine'
util.runner_available?({ :jasmine_url => 'http://localhost:8888/jasmine', :server_timeout => 15 })
end
end
Expand All @@ -27,7 +27,7 @@
end

it 'does show that the runner is not available' do
Guard::Jasmine::Formatter.should_receive(:error).with "Jasmine test runner isn't available: Connection refused"
Guard::Jasmine::Formatter.should_receive(:error).with 'Jasmine test runner isn\'t available: Connection refused'
util.runner_available?({ :jasmine_url => 'http://localhost:8888/jasmine', :server_timeout => 15 })
end
end
Expand All @@ -40,7 +40,7 @@
end

it 'does show that the runner is not available' do
Guard::Jasmine::Formatter.should_receive(:error).with 'Jasmine test runner fails with response code 404'
Guard::Jasmine::Formatter.should_receive(:error).with 'Jasmine test runner failed with status 404'
util.runner_available?({ :jasmine_url => 'http://localhost:8888/jasmine', :server_timeout => 15 })
end

Expand All @@ -50,8 +50,8 @@
end

it 'outputs the body for further analysis' do
Guard::Jasmine::Formatter.should_receive(:error).with 'Jasmine test runner fails with response code 404'
Guard::Jasmine::Formatter.should_receive(:error).with 'Something bad happened'
Guard::Jasmine::Formatter.should_receive(:error).with 'Jasmine test runner failed with status 404'
Guard::Jasmine::Formatter.should_receive(:error).with 'Please open the Jasmine runner in your browser for more information.'
util.runner_available?({ :jasmine_url => 'http://localhost:8888/jasmine', :server_timeout => 15 })
end
end
Expand Down

0 comments on commit 6d337ad

Please sign in to comment.