Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Session is responsible for starting server

  • Loading branch information...
commit 61a6561d62e9b707b9cdd0eb1ccaffd0b3ee3e59 1 parent dc5e032
@mhoran mhoran authored
View
16 lib/capybara/webkit/driver.rb
@@ -14,8 +14,6 @@ class Driver
def initialize(app, options={})
@app = app
@options = options
- @rack_server = Capybara::Server.new(@app)
- @rack_server.boot if Capybara.run_server
@browser = options[:browser] || Browser.new(Connection.new(options))
end
@@ -32,7 +30,7 @@ def requested_url
end
def visit(path)
- browser.visit(url(path))
+ browser.visit(path)
end
def find(query)
@@ -147,6 +145,10 @@ def wait?
true
end
+ def needs_server?
+ true
+ end
+
def wait_until(*args)
end
@@ -165,10 +167,6 @@ def render(path, options={})
browser.render path, options[:width], options[:height]
end
- def server_port
- @rack_server.port
- end
-
def cookies
@cookie_jar ||= CookieJar.new(browser)
end
@@ -178,9 +176,5 @@ def invalid_element_errors
end
private
-
- def url(path)
- @rack_server.url(path)
- end
end
end
View
2  spec/connection_spec.rb
@@ -3,7 +3,7 @@
describe Capybara::Webkit::Connection do
it "boots a server to talk to" do
- url = @rack_server.url("/")
+ url = "http://#{@rack_server.host}:#{@rack_server.port}/"
connection.puts "Visit"
connection.puts 1
connection.puts url.to_s.bytesize
View
13 spec/support/app_runner.rb
@@ -1,5 +1,5 @@
# Boots a single Capybara::Server for a Rack application that delegates to another, singleton Rack
-# application that can be configured for each spec. Also configures Capybara to use that server.
+# application that can be configured for each spec.
require 'sinatra/base'
@@ -51,17 +51,6 @@ def build_driver
def self.included(example_group)
example_group.class_eval do
before { AppRunner.reset }
-
- around do |example|
- Capybara.run_server = false
- Capybara.app_host = AppRunner.app_host
- begin
- example.run
- ensure
- Capybara.run_server = true
- Capybara.app_host = nil
- end
- end
end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.