Class: Kookaburra::GivenDriver Abstract
- Inherits:
-
Object
- Object
- Kookaburra::GivenDriver
- 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.
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.
40 41 42 |
# File 'lib/kookaburra/given_driver.rb', line 40 def initialize(configuration) @configuration = configuration end |
Instance Attribute Details
#configuration ⇒ Object (readonly, protected)
Returns the value of attribute configuration.
46 47 48 |
# File 'lib/kookaburra/given_driver.rb', line 46 def configuration @configuration end |
#mental_model ⇒ Object (protected)
Access to the shared MentalModel instance
51 |
# File 'lib/kookaburra/given_driver.rb', line 51 delegate :mental_model, :to => :configuration |
Instance Method Details
#api ⇒ Kookaburra::APIDriver (protected)
Used to access your APIDriver in your own GivenDriver implementation
59 60 61 |
# File 'lib/kookaburra/given_driver.rb', line 59 def api raise ConfigurationError, "You must implement #api in your subclass." end |