mirror of
https://github.com/teamcapybara/capybara.git
synced 2022-11-09 12:08:07 -05:00
Make sure server does nothing when no app given
This commit is contained in:
parent
0e6836f548
commit
2b6fd77db5
2 changed files with 7 additions and 0 deletions
|
@ -55,6 +55,7 @@ class Capybara::Server
|
|||
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}"
|
||||
|
|
|
@ -10,6 +10,12 @@ describe Capybara::Server do
|
|||
|
||||
@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!"]}
|
||||
|
|
Loading…
Add table
Reference in a new issue