Class: Kookaburra::Configuration
- Inherits:
-
Object
- Object
- Kookaburra::Configuration
- Defined in:
- lib/kookaburra/configuration.rb,
lib/kookaburra/configuration/proxy.rb
Overview
Provides access to the configuration data used throughout Kookaburra
Instance Attribute Summary collapse
-
#api_driver_class ⇒ Object
The class to use as your APIDriver.
-
#app_host ⇒ Object
This is the root URL of your running application, including the port number if necessary.
-
#browser ⇒ Object
This object is used by UIDriver::UIComponent to interface with the web browser.
-
#logger ⇒ Object
This is the logger to which Kookaburra will send various messages about its operation.
-
#mental_model ⇒ Object
This is the MentalModel that is shared between your APIDriver and your UIDriver.
-
#ui_driver_class ⇒ Object
The class to use as your UIDriver.
Instance Method Summary collapse
-
#app_host_uri ⇒ URI
The parsed version of the #app_host.
- #application(name, &block) ⇒ Object
- #applications ⇒ Object
- #has_named_applications? ⇒ Boolean
-
#server_error_detection { ... } ⇒ Object
Specify a function that can be used to determine if a server error has occured within your application.
Instance Attribute Details
#api_driver_class ⇒ Object
The class to use as your APIDriver
17 |
# File 'lib/kookaburra/configuration.rb', line 17 dependency_accessor :api_driver_class |
#app_host ⇒ Object
This is the root URL of your running application, including the port number if necessary. (e.g. "http://my.example.com:12345")
41 |
# File 'lib/kookaburra/configuration.rb', line 41 dependency_accessor :app_host |
#browser ⇒ Object
This object is used by UIDriver::UIComponent to interface with the web browser. Typically it should be an instance of Capybara::Session
33 |
# File 'lib/kookaburra/configuration.rb', line 33 dependency_accessor :browser |
#logger ⇒ Object
This is the logger to which Kookaburra will send various messages about its operation. This would generally be used to allow UIDriver subclasses to provide detailed failure information.
48 |
# File 'lib/kookaburra/configuration.rb', line 48 dependency_accessor :logger |
#mental_model ⇒ Object
This is the MentalModel that is shared between your APIDriver and your UIDriver. This attribute is managed by Kookaburra, so you shouldn't need to change it yourself.
84 85 86 |
# File 'lib/kookaburra/configuration.rb', line 84 def mental_model @mental_model ||= MentalModel.new end |
#ui_driver_class ⇒ Object
The class to use as your UIDriver
24 |
# File 'lib/kookaburra/configuration.rb', line 24 dependency_accessor :ui_driver_class |
Instance Method Details
#app_host_uri ⇒ URI
The parsed version of the #app_host
This is useful if, for example, you are testing a multi-host application and need to change the hostname that will be accessed but want to keep the originally-specified port
77 78 79 |
# File 'lib/kookaburra/configuration.rb', line 77 def app_host_uri URI.parse(app_host) end |
#application(name, &block) ⇒ Object
90 91 92 93 94 |
# File 'lib/kookaburra/configuration.rb', line 90 def application(name, &block) proxy = Proxy.new(name: name, basis: self) block.call(proxy) if block_given? applications[name] = Kookaburra.new(proxy) end |
#applications ⇒ Object
96 97 98 |
# File 'lib/kookaburra/configuration.rb', line 96 def applications @applications ||= {} end |
#has_named_applications? ⇒ Boolean
100 101 102 |
# File 'lib/kookaburra/configuration.rb', line 100 def has_named_applications? !applications.empty? end |
#server_error_detection { ... } ⇒ Object
Specify a function that can be used to determine if a server error has occured within your application.
If the function returns true
, then Kookaburra will assume that the
application has responded with an error.
62 63 64 65 66 67 68 |
# File 'lib/kookaburra/configuration.rb', line 62 def server_error_detection(&blk) if block_given? @server_error_detection = blk else @server_error_detection end end |