Permalink
Browse files

Make sure server does nothing when no app given

  • Loading branch information...
1 parent 0e6836f commit 2b6fd77db5473ce74fea5363ce25ff9b488cd0d7 @jnicklas jnicklas committed Mar 12, 2010
Showing with 7 additions and 0 deletions.
  1. +1 −0 lib/capybara/server.rb
  2. +6 −0 spec/server_spec.rb
View
@@ -55,6 +55,7 @@ def handler
end
def boot
+ return self unless @app
find_available_port
Capybara.log "application has already booted" and return self if responsive?
Capybara.log "booting Rack applicartion on port #{port}"
View
@@ -10,6 +10,12 @@
@res.body.should include('Hello Server')
end
+
+ it "should do nothing when no server given" do
+ running do
+ @server = Capybara::Server.new(nil).boot
+ end.should_not raise_error
+ end
it "should find an available port" do
@app1 = proc { |env| [200, {}, "Hello Server!"]}

0 comments on commit 2b6fd77

Please sign in to comment.