Class: ParserBenchmarkYAML

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

Instance Method Summary collapse

Instance Method Details

#benchmark_parserObject



142
143
144
# File 'lib/vendor/json_pure/benchmarks/parser_benchmark.rb', line 142

def benchmark_parser
  @result = YAML.load(@json)
end

#generic_reset_methodObject



146
147
148
# File 'lib/vendor/json_pure/benchmarks/parser_benchmark.rb', line 146

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

#setupObject



136
137
138
139
140
# File 'lib/vendor/json_pure/benchmarks/parser_benchmark.rb', line 136

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.pretty_generate(@big)
end