I am sure this is a very stupid question but I cannot get my head around it.
I have following ruby code:
sample_test = "Feature: Some terse yet descriptive text of what is desired
Textual description of the business value of this feature
Business rules that govern the scope of the feature
Any additional information that will make the feature easier to understand
Scenario: Some determinable business situation
Given some precondition
And some other precondition
When some action by the actor
And some other action
And yet another action
Then some testable outcome is achieved
And something else we can check happens too"
io = StringIO.new
pretty_formatter = Gherkin::Formatter::PrettyFormatter.new(io, true, false)
json_formatter = Gherkin::Formatter::JSONFormatter.new(io)
parser = Gherkin::Parser::Parser.new(json_formatter)
result = parser.parse(sample_test, '', 0)
This returns True
.
But I want to get a JSON formatted result. What should I use to get JSON output of all the steps?