1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

"Use assert_nil if expecting nil from ...:in `...'. This will fail in minitest 6."

This commit is contained in:
Akira Matsuda 2016-12-25 10:29:45 +09:00
parent 4ba9e61d99
commit 019cc5960d
3 changed files with 4 additions and 5 deletions

View file

@ -166,8 +166,7 @@ class HttpTokenAuthenticationTest < ActionController::TestCase
test "token_and_options returns nil with no value after the equal sign" do test "token_and_options returns nil with no value after the equal sign" do
actual = ActionController::HttpAuthentication::Token.token_and_options(malformed_request).first actual = ActionController::HttpAuthentication::Token.token_and_options(malformed_request).first
expected = nil assert_nil actual
assert_equal(expected, actual)
end end
test "raw_params returns a tuple of two key value pair strings" do test "raw_params returns a tuple of two key value pair strings" do

View file

@ -537,10 +537,10 @@ class HashExtTest < ActiveSupport::TestCase
get_hash = proc { { a: "foo" }.with_indifferent_access } get_hash = proc { { a: "foo" }.with_indifferent_access }
hash = get_hash.call hash = get_hash.call
assert_equal "foo", hash.delete(:a) assert_equal "foo", hash.delete(:a)
assert_equal nil, hash.delete(:a) assert_nil hash.delete(:a)
hash = get_hash.call hash = get_hash.call
assert_equal "foo", hash.delete("a") assert_equal "foo", hash.delete("a")
assert_equal nil, hash.delete("a") assert_nil hash.delete("a")
end end
def test_indifferent_select def test_indifferent_select

View file

@ -175,6 +175,6 @@ class SafeBufferTest < ActiveSupport::TestCase
test "Should not affect frozen objects when accessing characters" do test "Should not affect frozen objects when accessing characters" do
x = "Hello".html_safe x = "Hello".html_safe
assert_equal nil, x[/a/, 1] assert_nil x[/a/, 1]
end end
end end