Class: Cucumber2RSpec::Feature
- Inherits:
-
Object
- Object
- Cucumber2RSpec::Feature
- Defined in:
- lib/cucumber2rspec/feature.rb
Overview
…
Instance Attribute Summary collapse
-
#_feature ⇒ Object
readonly
Returns the value of attribute _feature.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
Instance Method Summary collapse
- #background ⇒ Object
- #code ⇒ Object
-
#initialize(raw_feature_text) ⇒ Feature
constructor
A new instance of Feature.
- #scenarios ⇒ Object
Constructor Details
#initialize(raw_feature_text) ⇒ Feature
Returns a new instance of Feature.
7 8 9 10 |
# File 'lib/cucumber2rspec/feature.rb', line 7 def initialize raw_feature_text @raw = raw_feature_text @_feature = Cucumber2RSpec.parser.parse_or_fail(raw) # Cucumber::Ast::Feature end |
Instance Attribute Details
#_feature ⇒ Object (readonly)
Returns the value of attribute _feature.
5 6 7 |
# File 'lib/cucumber2rspec/feature.rb', line 5 def _feature @_feature end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/cucumber2rspec/feature.rb', line 5 def name @name end |
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
5 6 7 |
# File 'lib/cucumber2rspec/feature.rb', line 5 def raw @raw end |
Instance Method Details
#background ⇒ Object
18 19 20 21 |
# File 'lib/cucumber2rspec/feature.rb', line 18 def background _background = _feature.instance_variable_get('@background') Background.new self, _background if _background end |
#code ⇒ Object
27 28 29 30 31 32 33 |
# File 'lib/cucumber2rspec/feature.rb', line 27 def code Cucumber2RSpec.log { name } the_code = 'describe ' + name.inspect + ' do' + "\n\n" the_code << background.code + "\n\n" if background scenarios.each {|scenario| the_code << scenario.code + "\n\n" } the_code << "end" end |