Skip to content

Commit

Permalink
Use appropriate assertion based on expectation
Browse files Browse the repository at this point in the history
This resolves a stern Minitest “warning” about an upcoming
behavior change in MiniTest 6 that will result in the test failing.

minitest/minitest#666
  • Loading branch information
coreyward committed Jan 17, 2017
1 parent 33eef3f commit 307065f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions activesupport/test/json/decoding_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,17 @@ def self.json_create(object)
}

TESTS.each_with_index do |(json, expected), index|
fail_message = "JSON decoding failed for #{json}"

test "json decodes #{index}" do
with_tz_default "Eastern Time (US & Canada)" do
with_parse_json_times(true) do
silence_warnings do
assert_equal expected, ActiveSupport::JSON.decode(json), "JSON decoding \
failed for #{json}"
if expected.nil?
assert_nil ActiveSupport::JSON.decode(json), fail_message
else
assert_equal expected, ActiveSupport::JSON.decode(json), fail_message
end
end
end
end
Expand Down

0 comments on commit 307065f

Please sign in to comment.