Class: Parser2BenchmarkRails

Inherits:
Bullshit::RepeatCase
  • Object
show all
Defined in:
lib/vendor/json_pure/benchmarks/parser2_benchmark.rb

Instance Method Summary collapse

Instance Method Details

#benchmark_parserObject



174
175
176
# File 'lib/vendor/json_pure/benchmarks/parser2_benchmark.rb', line 174

def benchmark_parser
  @result = ActiveSupport::JSON.decode(@json)
end

#generic_reset_methodObject



178
179
180
# File 'lib/vendor/json_pure/benchmarks/parser2_benchmark.rb', line 178

def generic_reset_method
  @result == @big or raise "not equal"
end

#setupObject



168
169
170
171
172
# File 'lib/vendor/json_pure/benchmarks/parser2_benchmark.rb', line 168

def setup
  a = [ nil, false, true, "fÖß\nÄr", [ "n€st€d", true ], { "fooß" => "bär", "qu\r\nux" => true } ]
  @big = a * 100
  @json = JSON.generate(@big)
end