Class: Crab::CucumberToRallyAdapter
- Inherits:
-
Object
- Object
- Crab::CucumberToRallyAdapter
- Defined in:
- lib/crab/cucumber_to_rally_adapter.rb
Instance Attribute Summary collapse
-
#scenarios ⇒ Object
readonly
Returns the value of attribute scenarios.
-
#steps ⇒ Object
readonly
Returns the value of attribute steps.
Instance Method Summary collapse
- #description ⇒ Object
- #eof ⇒ Object
- #feature(feature) ⇒ Object
-
#initialize(feature_text, feature_file) ⇒ CucumberToRallyAdapter
constructor
A new instance of CucumberToRallyAdapter.
- #name ⇒ Object
- #scenario(scenario) ⇒ Object
- #step(step) ⇒ Object
-
#story_id ⇒ Object
Rally compat.
-
#uri(uri) ⇒ Object
Cucumber compat.
Constructor Details
#initialize(feature_text, feature_file) ⇒ CucumberToRallyAdapter
Returns a new instance of CucumberToRallyAdapter.
3 4 5 6 7 8 9 |
# File 'lib/crab/cucumber_to_rally_adapter.rb', line 3 def initialize(feature_text, feature_file) @scenarios = [] @steps = ActiveSupport::OrderedHash.new [] parser = Gherkin::Parser::Parser.new(self, false, "root", false) parser.parse feature_text, feature_file, 0 end |
Instance Attribute Details
#scenarios ⇒ Object (readonly)
Returns the value of attribute scenarios.
11 12 13 |
# File 'lib/crab/cucumber_to_rally_adapter.rb', line 11 def scenarios @scenarios end |
#steps ⇒ Object (readonly)
Returns the value of attribute steps.
11 12 13 |
# File 'lib/crab/cucumber_to_rally_adapter.rb', line 11 def steps @steps end |
Instance Method Details
#description ⇒ Object
24 25 26 |
# File 'lib/crab/cucumber_to_rally_adapter.rb', line 24 def description @feature.description.gsub(/^\n/, '') end |
#eof ⇒ Object
45 46 |
# File 'lib/crab/cucumber_to_rally_adapter.rb', line 45 def eof end |
#feature(feature) ⇒ Object
33 34 35 |
# File 'lib/crab/cucumber_to_rally_adapter.rb', line 33 def feature(feature) @feature = feature end |
#name ⇒ Object
19 20 21 22 |
# File 'lib/crab/cucumber_to_rally_adapter.rb', line 19 def name @feature.name.match(/^\[([^\]]+)\](.*)$/) $2.strip end |
#scenario(scenario) ⇒ Object
37 38 39 |
# File 'lib/crab/cucumber_to_rally_adapter.rb', line 37 def scenario(scenario) @scenarios << scenario end |
#step(step) ⇒ Object
41 42 43 |
# File 'lib/crab/cucumber_to_rally_adapter.rb', line 41 def step(step) @steps[@scenarios.last] += Array(step) end |
#story_id ⇒ Object
Rally compat
14 15 16 17 |
# File 'lib/crab/cucumber_to_rally_adapter.rb', line 14 def story_id @feature.name.match(/^\[([^\]]+)\](.*)$/) $1.strip end |
#uri(uri) ⇒ Object
Cucumber compat
29 30 31 |
# File 'lib/crab/cucumber_to_rally_adapter.rb', line 29 def uri(uri) @uri end |