json icon indicating copy to clipboard operation
json copied to clipboard

:space_before is broken

Open tenkai opened this issue 11 years ago • 2 comments

puts JSON.generate( { "test" =>1, "omg" => "wtf"}, :indent => " ", :object_nl => "\n", :space_before => " ", :space => " ")

the above line yields: { "test": 1, "omg": "wtf" }

when it is expected to yield: (the space before the : is not there)

{ "test" : 1, "omg" : "wtf" }

tenkai avatar Feb 18 '14 21:02 tenkai

I noticed that none of the generate tests actually test space_before. in each test the value is "" https://github.com/flori/json/blob/e6f3fdc135f10458e090201fbb15fafbaa166a0d/tests/test_json_generate.rb

tenkai avatar Feb 18 '14 21:02 tenkai

I sent a pull to solve this issue: https://github.com/flori/json/pull/225

mmacvicar avatar Dec 20 '14 22:12 mmacvicar