Skip to content

Commit

Permalink
jsi_coder_test use normal JSON instances without mutation
Browse files Browse the repository at this point in the history
  • Loading branch information
notEthan committed Oct 29, 2023
1 parent 2e303b1 commit 141e8b6
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions test/jsi_coder_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@
assert_equal([], coder.load([]))
end
it 'loads a not an array' do
assert_raises(TypeError) do
coder.load(Object.new)
end
assert_raises(TypeError) { coder.load({"foo" => "bar"}) }
end
end
describe 'array schema' do
Expand All @@ -51,8 +49,7 @@
assert_equal(schema.new_jsi([]), coder.load([]))
end
it 'loads a not an array' do
instance = Object.new
assert_equal(schema.new_jsi(instance), coder.load(instance))
assert_equal(schema.new_jsi({"foo" => "bar"}), coder.load({"foo" => "bar"}))
end
end
end
Expand All @@ -71,7 +68,7 @@
it 'dumps some of the keys of a JSI after loading in a partial one' do
jsi = coder.load({'foo' => 'who'})
assert_equal({'foo' => 'who'}, coder.dump(jsi))
jsi.bar = 'whar'
jsi = jsi.merge('bar' => 'whar')
assert_equal({'foo' => 'who', 'bar' => 'whar'}, coder.dump(jsi))
end
describe 'array' do
Expand Down

0 comments on commit 141e8b6

Please sign in to comment.