Sha256: b94dfc0fc0e405ec987ffad893267caecbb2a44ebccbeffd66120a28bad32f54

Contents?: true

Size: 639 Bytes

Versions: 24

Compression:

Stored size: 639 Bytes

Contents

require 'ap' # awesome_print gem
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).ai
  actual   = JSON.parse(@io.string).ai
  actual.should == expected
end



Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
gherkin-2.4.6 features/step_definitions/json_formatter_steps.rb
gherkin-2.4.6-x86-mswin32 features/step_definitions/json_formatter_steps.rb
gherkin-2.4.6-x86-mingw32 features/step_definitions/json_formatter_steps.rb
gherkin-2.4.6-universal-dotnet features/step_definitions/json_formatter_steps.rb
gherkin-2.4.6-java features/step_definitions/json_formatter_steps.rb
gherkin-2.4.5 features/step_definitions/json_formatter_steps.rb
gherkin-2.4.5-x86-mswin32 features/step_definitions/json_formatter_steps.rb
gherkin-2.4.5-x86-mingw32 features/step_definitions/json_formatter_steps.rb
gherkin-2.4.5-universal-dotnet features/step_definitions/json_formatter_steps.rb
gherkin-2.4.5-java features/step_definitions/json_formatter_steps.rb
gherkin-2.4.4-x86-mswin32 features/step_definitions/json_formatter_steps.rb
gherkin-2.4.4-x86-mingw32 features/step_definitions/json_formatter_steps.rb
gherkin-2.4.4-universal-dotnet features/step_definitions/json_formatter_steps.rb
gherkin-2.4.4-java features/step_definitions/json_formatter_steps.rb
gherkin-2.4.3 features/step_definitions/json_formatter_steps.rb
gherkin-2.4.3-x86-mswin32 features/step_definitions/json_formatter_steps.rb
gherkin-2.4.3-x86-mingw32 features/step_definitions/json_formatter_steps.rb
gherkin-2.4.3-universal-dotnet features/step_definitions/json_formatter_steps.rb
gherkin-2.4.3-java features/step_definitions/json_formatter_steps.rb
gherkin-2.4.2 features/step_definitions/json_formatter_steps.rb