Sha256: c603b1d14b7df3d6a2bf90cc861f35aa33e55d86a15bba2df61242e3e1736bb8
Contents?: true
Size: 625 Bytes
Versions: 21
Compression:
Stored size: 625 Bytes
Contents
require 'gherkin/formatter/json_formatter' require 'gherkin/parser/parser' module Gherkin::Formatter class JSONFormatter def to_hash @feature_hash end end end module Wally class ParsesFeatures def parse text io = StringIO.new formatter = Gherkin::Formatter::JSONFormatter.new(io) parser = Gherkin::Parser::Parser.new(formatter, false, 'root') begin parser.parse(text, nil, 0) rescue Exception => e raise FeatureParseException.new end hash = formatter.to_hash hash end end class FeatureParseException < StandardError end end
Version data entries
21 entries across 21 versions & 2 rubygems