Class: FeatureBehavior::Runner
- Inherits:
-
Object
- Object
- FeatureBehavior::Runner
- Defined in:
- lib/feature_behavior/runner.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#example ⇒ Object
readonly
Returns the value of attribute example.
-
#example_block ⇒ Object
readonly
Returns the value of attribute example_block.
-
#skipped ⇒ Object
readonly
Returns the value of attribute skipped.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(description, example = nil, no_skip = true, &block) ⇒ Runner
constructor
A new instance of Runner.
- #run ⇒ Object
Constructor Details
#initialize(description, example = nil, no_skip = true, &block) ⇒ Runner
Returns a new instance of Runner.
10 11 12 13 14 15 |
# File 'lib/feature_behavior/runner.rb', line 10 def initialize(description, example = nil, no_skip = true, &block) @description = description @example = example @example_block = block @skipped = !no_skip end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
8 9 10 |
# File 'lib/feature_behavior/runner.rb', line 8 def description @description end |
#example ⇒ Object (readonly)
Returns the value of attribute example.
8 9 10 |
# File 'lib/feature_behavior/runner.rb', line 8 def example @example end |
#example_block ⇒ Object (readonly)
Returns the value of attribute example_block.
8 9 10 |
# File 'lib/feature_behavior/runner.rb', line 8 def example_block @example_block end |
#skipped ⇒ Object (readonly)
Returns the value of attribute skipped.
8 9 10 |
# File 'lib/feature_behavior/runner.rb', line 8 def skipped @skipped end |
Class Method Details
.run(description, example = nil, no_skip = true, &block) ⇒ Object
4 5 6 |
# File 'lib/feature_behavior/runner.rb', line 4 def self.run(description, example = nil, no_skip = true, &block) new(description, example, no_skip, &block).run end |
Instance Method Details
#run ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/feature_behavior/runner.rb', line 17 def run before_behavior notify :behavior_started if skipped reporter.notify :behavior_skipped, skipped_behavior_args else run_example! notify :behavior_passed end notify :behavior_terminated after_behavior end |