Skip to content

Commit

Permalink
Increase default server and runnder timeout. (See #106)
Browse files Browse the repository at this point in the history
  • Loading branch information
netzpirat committed Jan 24, 2013
1 parent 312f41a commit e1be6c1
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 11 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## Master

- Increase default server and runnder timeout.
## 1.12.0 - January 24, 2013

- [#102](https://github.com/netzpirat/guard-jasmine/pull/102): Jasmine gem server doesn't respond to `/jasmine` path.
- Switch coverage from [jscoverage](http://siliconforks.com/jscoverage/) to [Istanbul](https://github.com/gotwarlost/istanbul).
- [#77](https://github.com/netzpirat/guard-jasmine/pull/77): Add coverage support. ([@alexspeller][])
Expand Down
4 changes: 2 additions & 2 deletions lib/guard/jasmine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ class Jasmine < Guard
DEFAULT_OPTIONS = {
:server => :auto,
:server_env => ENV['RAILS_ENV'] || 'development',
:server_timeout => 15,
:server_timeout => 60,
:port => nil,
:rackup_config => nil,
:jasmine_url => nil,
:timeout => 10,
:timeout => 60,
:spec_dir => 'spec/javascripts',
:notification => true,
:hide_success => false,
Expand Down
4 changes: 2 additions & 2 deletions lib/guard/jasmine/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class CLI < Thor

method_option :server_timeout,
:type => :numeric,
:default => 15,
:default => 60,
:desc => 'The number of seconds to wait for the Jasmine spec server'

method_option :rackup_config,
Expand All @@ -68,7 +68,7 @@ class CLI < Thor
method_option :timeout,
:type => :numeric,
:aliases => '-t',
:default => 10,
:default => 60,
:desc => 'The maximum time in seconds to wait for the spec runner to finish'

method_option :console,
Expand Down
2 changes: 1 addition & 1 deletion spec/guard/jasmine/cli_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@
end

it 'sets the timeout' do
runner.should_receive(:run).with(anything(), hash_including(:timeout => 10)).and_return [true, []]
runner.should_receive(:run).with(anything(), hash_including(:timeout => 60)).and_return [true, []]
cli.start(['spec'])
end

Expand Down
8 changes: 4 additions & 4 deletions spec/guard/jasmine/runner_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@

context 'when passed the spec directory' do
it 'requests all jasmine specs from the server' do
IO.should_receive(:popen).with("#{ phantomjs_command } \"http://localhost:8888/jasmine\" 10000 failure true failure failure", "r:UTF-8")
IO.should_receive(:popen).with("#{ phantomjs_command } \"http://localhost:8888/jasmine\" 60000 failure true failure failure", "r:UTF-8")
runner.run(['spec/javascripts'], defaults.merge({ :notification => false }))
end

Expand All @@ -215,7 +215,7 @@

context 'for an erroneous Jasmine runner' do
it 'requests the jasmine specs from the server' do
IO.should_receive(:popen).with("#{ phantomjs_command } \"http://localhost:8888/jasmine?spec=ErrorTest\" 10000 failure true failure failure", "r:UTF-8")
IO.should_receive(:popen).with("#{ phantomjs_command } \"http://localhost:8888/jasmine?spec=ErrorTest\" 60000 failure true failure failure", "r:UTF-8")
runner.run(['spec/javascripts/a.js.coffee'], defaults)
end

Expand Down Expand Up @@ -265,7 +265,7 @@

it 'requests the jasmine specs from the server' do
File.should_receive(:foreach).with('spec/javascripts/x/b.js.coffee').and_yield 'describe "FailureTest", ->'
IO.should_receive(:popen).with("#{ phantomjs_command } \"http://localhost:8888/jasmine?spec=FailureTest\" 10000 failure true failure failure", "r:UTF-8")
IO.should_receive(:popen).with("#{ phantomjs_command } \"http://localhost:8888/jasmine?spec=FailureTest\" 60000 failure true failure failure", "r:UTF-8")
runner.run(['spec/javascripts/x/b.js.coffee'], defaults)
end

Expand Down Expand Up @@ -609,7 +609,7 @@

it 'requests the jasmine specs from the server' do
File.should_receive(:foreach).with('spec/javascripts/t.js').and_yield 'describe("SuccessTest", function() {'
IO.should_receive(:popen).with("#{ phantomjs_command } \"http://localhost:8888/jasmine?spec=SuccessTest\" 10000 failure true failure failure", "r:UTF-8")
IO.should_receive(:popen).with("#{ phantomjs_command } \"http://localhost:8888/jasmine?spec=SuccessTest\" 60000 failure true failure failure", "r:UTF-8")

runner.run(['spec/javascripts/t.js'], defaults)
end
Expand Down
4 changes: 2 additions & 2 deletions spec/guard/jasmine_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
end

it 'sets a default :server_timeout option' do
guard.options[:server_timeout].should eql 15
guard.options[:server_timeout].should eql 60
end

it 'finds a free port for the :port option' do
Expand All @@ -45,7 +45,7 @@
end

it 'sets a default :timeout option' do
guard.options[:timeout].should eql 10
guard.options[:timeout].should eql 60
end

it 'sets a default :spec_dir option' do
Expand Down

0 comments on commit e1be6c1

Please sign in to comment.