Object
# File lib/gherkin/formatter/json_formatter.rb, line 25 def background(comments, keyword, name, description, line) background = { 'comments' => comments.to_a, 'keyword' => keyword, 'name' => name, 'description' => description, 'line' => line, 'steps' => [], } @json_hash['background'] = background @in_background = true end
# File lib/gherkin/formatter/json_formatter.rb, line 59 def eof @io.write(@json_hash.to_json) end
# File lib/gherkin/formatter/json_formatter.rb, line 48 def examples(comments, tags, keyword, name, description, line, table) @table_container = add_examples(comments, tags, keyword, name, description, line) @table_container['table'] = to_hash_array(table) end
# File lib/gherkin/formatter/json_formatter.rb, line 14 def feature(comments, tags, keyword, name, description, uri) @json_hash = { 'comments' => comments.to_a, 'tags' => tags.to_a, 'keyword' => keyword, 'name' => name, 'description' => description, 'uri' => uri } end
# File lib/gherkin/formatter/json_formatter.rb, line 38 def scenario(comments, tags, keyword, name, description, line) @in_background = false add_step_container(comments, tags, keyword, name, description, line, 'scenario') end
# File lib/gherkin/formatter/json_formatter.rb, line 43 def scenario_outline(comments, tags, keyword, name, description, line) @in_background = false add_step_container(comments, tags, keyword, name, description, line, 'scenario_outline') end
# File lib/gherkin/formatter/json_formatter.rb, line 53 def step(comments, keyword, name, line, multiline_arg, status, exception, arguments, stepdef_location) @table_container = {'comments' => comments.to_a, 'keyword' => keyword, 'name' => name, 'line' => line}.merge(step_arg_to_hash(multiline_arg)) last_element['steps'] ||= [] last_element['steps'] << @table_container end
Generated with the Darkfish Rdoc Generator 2.