spec/support/file_helpers.rb in json_matchers-0.6.1 vs spec/support/file_helpers.rb in json_matchers-0.6.2

- old
+ new

@@ -1,14 +1,17 @@ +require "fileutils" +require "json" + module FileHelpers ORIGINAL_SCHEMA_ROOT = JsonMatchers.schema_root def create_schema(name, json) File.open("#{schema_root}/#{name}.json", "w") do |file| case json when NilClass, String file.write(json.to_s) else - file.write(json.to_json) + file.write(JSON.generate(json)) end end end def response_for(json)