Class: Kikambii::Feature
- Inherits:
-
Object
- Object
- Kikambii::Feature
- Defined in:
- lib/kikambii/feature.rb
Constant Summary collapse
- MAXIMUM_RETRIES =
3
Instance Attribute Summary collapse
-
#attemps ⇒ Object
readonly
Returns the value of attribute attemps.
-
#feature ⇒ Object
readonly
Returns the value of attribute feature.
-
#runner ⇒ Object
readonly
Returns the value of attribute runner.
-
#scenarios ⇒ Object
readonly
Returns the value of attribute scenarios.
Instance Method Summary collapse
- #fail? ⇒ Boolean
-
#initialize(dependencies) ⇒ Feature
constructor
A new instance of Feature.
- #run ⇒ Object
Constructor Details
#initialize(dependencies) ⇒ Feature
Returns a new instance of Feature.
7 8 9 |
# File 'lib/kikambii/feature.rb', line 7 def initialize(dependencies) @feature, @scenarios, @runner, @attemps = dependencies[:feature], dependencies[:scenarios], dependencies[:runner], 0 end |
Instance Attribute Details
#attemps ⇒ Object (readonly)
Returns the value of attribute attemps.
5 6 7 |
# File 'lib/kikambii/feature.rb', line 5 def attemps @attemps end |
#feature ⇒ Object (readonly)
Returns the value of attribute feature.
5 6 7 |
# File 'lib/kikambii/feature.rb', line 5 def feature @feature end |
#runner ⇒ Object (readonly)
Returns the value of attribute runner.
5 6 7 |
# File 'lib/kikambii/feature.rb', line 5 def runner @runner end |
#scenarios ⇒ Object (readonly)
Returns the value of attribute scenarios.
5 6 7 |
# File 'lib/kikambii/feature.rb', line 5 def scenarios @scenarios end |
Instance Method Details
#fail? ⇒ Boolean
20 21 22 |
# File 'lib/kikambii/feature.rb', line 20 def fail? @scenarios.any? end |
#run ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/kikambii/feature.rb', line 11 def run return true unless should_run? @scenarios.delete_if { |scenario| @runner.run command_for(scenario) } @attemps += 1 @scenarios.empty? end |