Class: Cucumber2RSpec::Background
- Inherits:
-
Object
- Object
- Cucumber2RSpec::Background
- Defined in:
- lib/cucumber2rspec/background.rb
Overview
…
Instance Attribute Summary collapse
-
#_background ⇒ Object
readonly
Returns the value of attribute _background.
-
#feature ⇒ Object
readonly
Returns the value of attribute feature.
Instance Method Summary collapse
- #code ⇒ Object
- #code_without_block ⇒ Object
-
#initialize(feature, cucumber_ast_background) ⇒ Background
constructor
A new instance of Background.
- #steps ⇒ Object
Constructor Details
#initialize(feature, cucumber_ast_background) ⇒ Background
Returns a new instance of Background.
7 8 9 10 |
# File 'lib/cucumber2rspec/background.rb', line 7 def initialize feature, cucumber_ast_background @feature = feature @_background = cucumber_ast_background # Cucumber::Ast::Background end |
Instance Attribute Details
#_background ⇒ Object (readonly)
Returns the value of attribute _background.
5 6 7 |
# File 'lib/cucumber2rspec/background.rb', line 5 def _background @_background end |
#feature ⇒ Object (readonly)
Returns the value of attribute feature.
5 6 7 |
# File 'lib/cucumber2rspec/background.rb', line 5 def feature @feature end |
Instance Method Details
#code ⇒ Object
20 21 22 23 24 25 |
# File 'lib/cucumber2rspec/background.rb', line 20 def code Cucumber2RSpec.log { ' Background' } the_code = " before do\n" the_code << code_without_block.sub(/\n$/, '') # kill the last newline the_code << ' end' end |
#code_without_block ⇒ Object
16 17 18 |
# File 'lib/cucumber2rspec/background.rb', line 16 def code_without_block Step.code_for_steps(steps) end |