Class: Capybara::Mechanize::Driver

Inherits:
RackTest::Driver
  • Object
show all
Defined in:
lib/capybara/mechanize/driver.rb

Instance Method Summary collapse

Constructor Details

#initialize(app = nil, options = {}) ⇒ Driver

Returns a new instance of Driver.



5
6
7
8
9
10
11
# File 'lib/capybara/mechanize/driver.rb', line 5

def initialize(app = nil, options = {})
  if !app && !Capybara.app_host
    raise ArgumentError, "You have to set at least Capybara.app_host or Capybara.app"
  end

  @app, @options = app, options
end

Instance Method Details

#browserObject



17
18
19
# File 'lib/capybara/mechanize/driver.rb', line 17

def browser
  @browser ||= Capybara::Mechanize::Browser.new(self)
end

#remote?(url) ⇒ Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/capybara/mechanize/driver.rb', line 13

def remote?(url)
  browser.remote?(url)
end