Class: Kookaburra::GivenDriver Abstract
- Inherits:
-
Object
- Object
- Kookaburra::GivenDriver
- Extended by:
- Forwardable
- Defined in:
- lib/kookaburra/given_driver.rb
Overview
Subclass and implement your Given DSL.
Your GivenDriver subclass is used to define your testing DSL for setting up test preconditions. Unlike APIDriver, which is meant to be a simple mapping to your application's API, a method in the GivenDriver may be comprised of several distinct API calls as well as access to Kookaburra's test data store via #mental_model.
Instance Attribute Summary collapse
-
#configuration ⇒ Object
readonly
protected
Returns the value of attribute configuration.
-
#mental_model ⇒ Object
protected
Access to the shared MentalModel instance.
Instance Method Summary collapse
-
#api ⇒ Kookaburra::APIDriver
protected
abstract
Used to access your APIDriver in your own GivenDriver implementation.
-
#initialize(configuration) ⇒ GivenDriver
constructor
It is unlikely that you would call #initialize yourself; your GivenDriver object is instantiated for you by #given.
Constructor Details
#initialize(configuration) ⇒ GivenDriver
It is unlikely that you would call #initialize yourself; your GivenDriver object is instantiated for you by Kookaburra#given.
42 43 44 |
# File 'lib/kookaburra/given_driver.rb', line 42 def initialize(configuration) @configuration = configuration end |
Instance Attribute Details
#configuration ⇒ Object (readonly, protected)
Returns the value of attribute configuration.
48 49 50 |
# File 'lib/kookaburra/given_driver.rb', line 48 def configuration @configuration end |
#mental_model ⇒ Object (protected)
Access to the shared MentalModel instance
53 |
# File 'lib/kookaburra/given_driver.rb', line 53 def_delegator :configuration, :mental_model |
Instance Method Details
#api ⇒ Kookaburra::APIDriver (protected)
Used to access your APIDriver in your own GivenDriver implementation
61 62 63 |
# File 'lib/kookaburra/given_driver.rb', line 61 def api raise ConfigurationError, "You must implement #api in your subclass." end |