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 92 92: def initialize(parser) 93: @parser = parser 94: end
# File vendor/plugins/rspec/lib/spec/story/runner/story_parser.rb, line 116 116: def event(line) 117: @parser.create_when(remove_tag_from(:when, line)) 118: @parser.transition_to(:when_state) 119: end
# File vendor/plugins/rspec/lib/spec/story/runner/story_parser.rb, line 106 106: def given(line) 107: @parser.create_given(remove_tag_from(:given, line)) 108: @parser.transition_to(:given_state) 109: end
# File vendor/plugins/rspec/lib/spec/story/runner/story_parser.rb, line 111 111: def given_scenario(line) 112: @parser.create_given_scenario(remove_tag_from(:givenscenario, line)) 113: @parser.transition_to(:given_state) 114: end
# File vendor/plugins/rspec/lib/spec/story/runner/story_parser.rb, line 136 136: def other(line) 137: # no-op - supports header text before the first story in a file 138: end
# File vendor/plugins/rspec/lib/spec/story/runner/story_parser.rb, line 121 121: def outcome(line) 122: @parser.create_then(remove_tag_from(:then, line)) 123: @parser.transition_to(:then_state) 124: end
# File vendor/plugins/rspec/lib/spec/story/runner/story_parser.rb, line 126 126: def remove_tag_from(tag, line) 127: tokens = line.split 128: # validation of tag can go here 129: tokens[0].downcase.match(/#{tag.to_s}:?/) ? 130: (tokens[1..-1].join(' ')) : line 131: end
# File vendor/plugins/rspec/lib/spec/story/runner/story_parser.rb, line 101 101: def scenario(line) 102: @parser.create_scenario(line) 103: @parser.transition_to(:scenario_state) 104: end