module Pact::JRubySupport
Public Instance Methods
fix_blank_lines_in_empty_hashes(json)
click to toggle source
Under jruby, JSON.pretty_generate inserts a blank new line between the opening and closing brackets of an empty hash, like so: {
"empty": { }
} This screws up the UnixDiffFormatter, so we need to remove the blank lines.
# File lib/pact/shared/jruby_support.rb, line 13 def fix_blank_lines_in_empty_hashes json json.gsub(/({\n)\n(\s*})/,'\1\2') end