Skip to content

Commit

Permalink
Merge pull request #44390 from p8/actionpack/silence-uninitialized-iv…
Browse files Browse the repository at this point in the history
…ar-warning

Silence uninitialized instance var warning in tests
  • Loading branch information
kamipo committed Feb 11, 2022
2 parents af1355e + c9cb1aa commit b50095f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions actionpack/test/controller/test_case_test.rb
Expand Up @@ -1003,8 +1003,10 @@ def test_reset_instance_variables_after_each_request
assert_equal "1", response.body
end

def test_can_read_instance_variables_before_or_after_request
assert_nil @controller.instance_variable_get(:@counter)
def test_can_read_instance_variables_before_and_after_request
silence_warnings do
assert_nil @controller.instance_variable_get(:@counter)
end

get :increment_count
assert_equal "1", response.body
Expand Down

0 comments on commit b50095f

Please sign in to comment.