Skip to content

Commit b45dd1f

Browse files
committed
Add Puma to the list of rack-compatible servers
1 parent 2494c28 commit b45dd1f

File tree

4 files changed

+27
-4
lines changed

4 files changed

+27
-4
lines changed

Diff for: CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Changelog
22

3+
- Add Puma as a rack-compatible server
4+
35
## 1.10.1 - November 19, 2012
46

57
- [Issue #90](https://github.com/netzpirat/guard-jasmine/issues/90): Fix wrong port in the default Jasmine url.

Diff for: README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ The server options configures the server environment that is needed to run Guard
342342

343343
```ruby
344344
:server => :jasmine_gem # Jasmine server to use, either :auto, :none,
345-
# :webrick, :mongrel, :thin, :unicorn, :jasmine_gem
345+
# :webrick, :mongrel, :thin, :unicorn, :jasmine_gem, :puma
346346
# default: :auto
347347

348348
:server_env => :test # Jasmine server Rails environment to set,
@@ -361,7 +361,7 @@ The server options configures the server environment that is needed to run Guard
361361
:timeout => 20 # The time in seconds to wait for the spec runner to finish.
362362
# default: 10
363363

364-
:rackup_config => 'spec/dummy/config.ru' # Path to rackup config file (i.e. for webrick, mongrel, thin, unicorn).
364+
:rackup_config => 'spec/dummy/config.ru' # Path to rackup config file (i.e. for webrick, mongrel, thin, unicorn, puma).
365365
# default: ./config.ru
366366
# This option is useful when using guard-jasmine in a mountable engine
367367
# and the config.ru is within the dummy app
@@ -537,7 +537,7 @@ Usage:
537537
guard-jasmine spec
538538

539539
Options:
540-
-s, [--server=SERVER] # Server to start, either `auto`, `webrick`, `mongrel`, `thin`,
540+
-s, [--server=SERVER] # Server to start, either `auto`, `webrick`, `mongrel`, `thin`, `puma`
541541
# `unicorn`, `jasmine_gem` or `none`
542542
# Default: auto
543543
-p, [--port=N] # Server port to use

Diff for: lib/guard/jasmine/server.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def start(options)
3232
timeout = options[:server_timeout]
3333

3434
case server
35-
when :webrick, :mongrel, :thin
35+
when :webrick, :mongrel, :thin, :puma
3636
start_rack_server(server, port, options)
3737
when :unicorn
3838
start_unicorn_server(port, options)

Diff for: spec/guard/jasmine/server_spec.rb

+21
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,27 @@
163163
end
164164
end
165165

166+
context 'with the :puma strategy' do
167+
let(:options) do
168+
defaults.merge({ :server => :puma })
169+
end
170+
171+
it 'does not auto detect a server' do
172+
server.should_not_receive(:detect_server)
173+
server.start(options)
174+
end
175+
176+
it 'does wait for the server' do
177+
server.should_receive(:wait_for_server)
178+
server.start(options)
179+
end
180+
181+
it 'starts a :puma rack server' do
182+
server.should_receive(:start_rack_server).with(:puma, 8888, options)
183+
server.start(options)
184+
end
185+
end
186+
166187
context 'with the :mongrel strategy' do
167188
let(:options) do
168189
defaults.merge({ :server => :mongrel })

0 commit comments

Comments
 (0)