Class: Capybara::Config
- Inherits:
-
Object
- Object
- Capybara::Config
- Extended by:
- Forwardable
- Defined in:
- lib/capybara/config.rb
Constant Summary collapse
- OPTIONS =
%i[app reuse_server threadsafe default_wait_time server default_driver javascript_driver].freeze
Instance Attribute Summary collapse
-
#app ⇒ Object
Returns the value of attribute app.
-
#default_driver ⇒ Symbol
The name of the driver to use by default.
-
#javascript_driver ⇒ Symbol
The name of the driver used when JavaScript is needed.
-
#reuse_server ⇒ Object
Returns the value of attribute reuse_server.
-
#server ⇒ Object
Return the proc that Capybara will call to run the Rack application.
-
#session_options ⇒ Object
readonly
Returns the value of attribute session_options.
-
#threadsafe ⇒ Object
Returns the value of attribute threadsafe.
Instance Method Summary collapse
- #deprecate(method, alternate_method, once = false) ⇒ Object
-
#initialize ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
21 22 23 24 |
# File 'lib/capybara/config.rb', line 21 def initialize @session_options = Capybara::SessionConfig.new @javascript_driver = nil end |
Instance Attribute Details
#app ⇒ Object
Returns the value of attribute app.
12 13 14 |
# File 'lib/capybara/config.rb', line 12 def app @app end |
#default_driver ⇒ Symbol
Returns The name of the driver to use by default.
70 71 72 |
# File 'lib/capybara/config.rb', line 70 def default_driver @default_driver || :rack_test end |
#javascript_driver ⇒ Symbol
Returns The name of the driver used when JavaScript is needed.
78 79 80 |
# File 'lib/capybara/config.rb', line 78 def javascript_driver @javascript_driver || :selenium end |
#reuse_server ⇒ Object
Returns the value of attribute reuse_server.
13 14 15 |
# File 'lib/capybara/config.rb', line 13 def reuse_server @reuse_server end |
#server ⇒ Object
Return the proc that Capybara will call to run the Rack application. The block returned receives a rack app, port, and host/ip and should run a Rack handler By default, Capybara will try to use puma.
39 40 41 |
# File 'lib/capybara/config.rb', line 39 def server @server end |
#session_options ⇒ Object (readonly)
Returns the value of attribute session_options.
14 15 16 |
# File 'lib/capybara/config.rb', line 14 def @session_options end |
#threadsafe ⇒ Object
Returns the value of attribute threadsafe.
13 14 15 |
# File 'lib/capybara/config.rb', line 13 def threadsafe @threadsafe end |
Instance Method Details
#deprecate(method, alternate_method, once = false) ⇒ Object
82 83 84 85 86 |
# File 'lib/capybara/config.rb', line 82 def deprecate(method, alternate_method, once = false) @deprecation_notified ||= {} warn "DEPRECATED: ##{method} is deprecated, please use ##{alternate_method} instead" unless once && @deprecation_notified[method] @deprecation_notified[method] = true end |