Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/multi_json/adapters/json_gem.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class JsonGem < Adapter
# Exception raised when JSON parsing fails
ParseError = ::JSON::ParserError

defaults :load, create_additions: false, quirks_mode: true
defaults :load, create_additions: false, quirks_mode: true if JSON::VERSION.to_i < 3 # simplecov:disable

PRETTY_STATE_PROTOTYPE = {
indent: " ",
Expand Down Expand Up @@ -44,7 +44,7 @@ def load(string, options = {})
raise ::JSON::ParserError, "Invalid UTF-8 byte sequence in JSON input" unless string.valid_encoding?
end

::JSON.parse(string, options)
::JSON.parse(string, **options)
end

# Serialize a Ruby object to JSON
Expand Down
4 changes: 2 additions & 2 deletions test/support/adapter_tests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ def subject
end

def test_does_not_modify_argument_hashes_when_loading
options = {symbolize_names: true, pretty: false, adapter: :json_gem}
options = {symbolize_names: true, adapter: :json_gem}
original = options.dup
MultiJSON.load("{}", options)

assert_equal original, options
end

def test_does_not_modify_argument_hashes_when_dumping
options = {symbolize_names: true, pretty: false, adapter: :json_gem}
options = {pretty: false, adapter: :json_gem}
original = options.dup
MultiJSON.dump([42], options)

Expand Down