Class Spec::Story::Runner::StoryParser::State
In: vendor/plugins/rspec/lib/spec/story/runner/story_parser.rb
Parent: Object

Methods

comment   eof   event   given   given_scenario   new   other   outcome   remove_tag_from   scenario   story  

Public Class methods

[Source]

    # File vendor/plugins/rspec/lib/spec/story/runner/story_parser.rb, line 97
97:           def initialize(parser)
98:             @parser = parser
99:           end

Public Instance methods

[Source]

     # File vendor/plugins/rspec/lib/spec/story/runner/story_parser.rb, line 145
145:           def comment(line)
146:           end

[Source]

     # File vendor/plugins/rspec/lib/spec/story/runner/story_parser.rb, line 138
138:           def eof
139:           end

[Source]

     # 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

[Source]

     # 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

[Source]

     # 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

[Source]

     # 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

[Source]

     # 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

[Source]

     # 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

[Source]

     # 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

[Source]

     # File vendor/plugins/rspec/lib/spec/story/runner/story_parser.rb, line 101
101:           def story(line)
102:             @parser.init_story(line)
103:             @parser.transition_to(:story_state)
104:           end

[Validate]