Skip to content

Commit

Permalink
Add Puma to the list of rack-compatible servers
Browse files Browse the repository at this point in the history
  • Loading branch information
mrship committed Dec 17, 2012
1 parent 2494c28 commit b45dd1f
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Changelog

- Add Puma as a rack-compatible server

## 1.10.1 - November 19, 2012

- [Issue #90](https://github.com/netzpirat/guard-jasmine/issues/90): Fix wrong port in the default Jasmine url.
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ The server options configures the server environment that is needed to run Guard

```ruby
:server => :jasmine_gem # Jasmine server to use, either :auto, :none,
# :webrick, :mongrel, :thin, :unicorn, :jasmine_gem
# :webrick, :mongrel, :thin, :unicorn, :jasmine_gem, :puma
# default: :auto

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

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

Options:
-s, [--server=SERVER] # Server to start, either `auto`, `webrick`, `mongrel`, `thin`,
-s, [--server=SERVER] # Server to start, either `auto`, `webrick`, `mongrel`, `thin`, `puma`
# `unicorn`, `jasmine_gem` or `none`
# Default: auto
-p, [--port=N] # Server port to use
Expand Down
2 changes: 1 addition & 1 deletion lib/guard/jasmine/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def start(options)
timeout = options[:server_timeout]

case server
when :webrick, :mongrel, :thin
when :webrick, :mongrel, :thin, :puma
start_rack_server(server, port, options)
when :unicorn
start_unicorn_server(port, options)
Expand Down
21 changes: 21 additions & 0 deletions spec/guard/jasmine/server_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,27 @@
end
end

context 'with the :puma strategy' do
let(:options) do
defaults.merge({ :server => :puma })
end

it 'does not auto detect a server' do
server.should_not_receive(:detect_server)
server.start(options)
end

it 'does wait for the server' do
server.should_receive(:wait_for_server)
server.start(options)
end

it 'starts a :puma rack server' do
server.should_receive(:start_rack_server).with(:puma, 8888, options)
server.start(options)
end
end

context 'with the :mongrel strategy' do
let(:options) do
defaults.merge({ :server => :mongrel })
Expand Down

0 comments on commit b45dd1f

Please sign in to comment.