提交 8ad8093a 编写于 作者: A Akira Matsuda & yui-knk 提交者: Akira Matsuda

Suppress "unused variable" in Ruby 2.5

上级 61f92f8b
......@@ -87,7 +87,8 @@ def test_negative_differences
def test_expression_is_evaluated_in_the_appropriate_scope
silence_warnings do
local_scope = local_scope = "foo"
local_scope = "foo";
local_scope = local_scope # to suppress unused variable warning
assert_difference("local_scope; @object.num") { @object.increment }
end
end
......@@ -200,7 +201,7 @@ def test_assert_changes_works_with_nil
def test_assert_changes_with_to_and_case_operator
token = nil
assert_changes "token", to: /\w{32}/ do
assert_changes -> { token }, to: /\w{32}/ do
token = SecureRandom.hex
end
end
......@@ -208,7 +209,7 @@ def test_assert_changes_with_to_and_case_operator
def test_assert_changes_with_to_and_from_and_case_operator
token = SecureRandom.hex
assert_changes "token", from: /\w{32}/, to: /\w{32}/ do
assert_changes -> { token }, from: /\w{32}/, to: /\w{32}/ do
token = SecureRandom.hex
end
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册