Class | Spec::Story::Runner::StoryParser::State |
In: |
vendor/plugins/rspec/lib/spec/story/runner/story_parser.rb
|
Parent: | Object |
# File vendor/plugins/rspec/lib/spec/story/runner/story_parser.rb, line 97 97: def initialize(parser) 98: @parser = parser 99: end
# File vendor/plugins/rspec/lib/spec/story/runner/story_parser.rb, line 145 145: def comment(line) 146: end
# File vendor/plugins/rspec/lib/spec/story/runner/story_parser.rb, line 121 121: def event(line) 122: @parser.create_when(remove_tag_from(:when, line)) 123: @parser.transition_to(:when_state) 124: end
# File vendor/plugins/rspec/lib/spec/story/runner/story_parser.rb, line 111 111: def given(line) 112: @parser.create_given(remove_tag_from(:given, line)) 113: @parser.transition_to(:given_state) 114: end
# File vendor/plugins/rspec/lib/spec/story/runner/story_parser.rb, line 116 116: def given_scenario(line) 117: @parser.create_given_scenario(remove_tag_from(:givenscenario, line)) 118: @parser.transition_to(:given_state) 119: end
# File vendor/plugins/rspec/lib/spec/story/runner/story_parser.rb, line 141 141: def other(line) 142: # no-op - supports header text before the first story in a file 143: end
# File vendor/plugins/rspec/lib/spec/story/runner/story_parser.rb, line 126 126: def outcome(line) 127: @parser.create_then(remove_tag_from(:then, line)) 128: @parser.transition_to(:then_state) 129: end
# File vendor/plugins/rspec/lib/spec/story/runner/story_parser.rb, line 131 131: def remove_tag_from(tag, line) 132: tokens = line.split 133: # validation of tag can go here 134: tokens[0].downcase.match(/#{tag.to_s}:?/) ? 135: (tokens[1..-1].join(' ')) : line 136: end
# File vendor/plugins/rspec/lib/spec/story/runner/story_parser.rb, line 106 106: def scenario(line) 107: @parser.create_scenario(line) 108: @parser.transition_to(:scenario_state) 109: end