Sha256: 8d122d97fc5c4fee65ef4949a1d9aef904b6aac2e3329538724410b714fe2f8c
Contents?: true
Size: 600 Bytes
Versions: 76
Compression:
Stored size: 600 Bytes
Contents
require 'stringio' require 'gherkin/formatter/json_formatter' require 'gherkin/listener/formatter_listener' # Monkey patching so that Hash.to_json has a predictable result. class Hash alias orig_keys keys def keys orig_keys.sort end end Given /^a JSON formatter$/ do @io = StringIO.new @formatter = Gherkin::Formatter::JSONFormatter.new(@io) end Then /^the outputted JSON should be:$/ do |expected_json| require 'json' puts JSON.pretty_generate(JSON.parse(@io.string)) expected = JSON.parse(expected_json) actual = JSON.parse(@io.string) actual.should == expected end
Version data entries
76 entries across 76 versions & 1 rubygems