From 811fd0a6b47c83cd4f668127bb822dc5cdcfc0f5 Mon Sep 17 00:00:00 2001 From: Andrew White Date: Sun, 3 Apr 2016 23:35:15 +0100 Subject: Prevent void context warnings The constant reference A::B used to trigger autoloading causes a warning to be logged about the possible use of :: in a void context so assign it to the _ variable to prevent the warnings from being triggered. --- activesupport/test/autoloading_fixtures/raises_arbitrary_exception.rb | 2 +- activesupport/test/autoloading_fixtures/throws.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'activesupport') diff --git a/activesupport/test/autoloading_fixtures/raises_arbitrary_exception.rb b/activesupport/test/autoloading_fixtures/raises_arbitrary_exception.rb index 404ae289c6..3ca4213c71 100644 --- a/activesupport/test/autoloading_fixtures/raises_arbitrary_exception.rb +++ b/activesupport/test/autoloading_fixtures/raises_arbitrary_exception.rb @@ -1,4 +1,4 @@ RaisesArbitraryException = 1 -A::B # Autoloading recursion, also expected to be watched and discarded. +_ = A::B # Autoloading recursion, also expected to be watched and discarded. raise Exception, 'arbitray exception message' diff --git a/activesupport/test/autoloading_fixtures/throws.rb b/activesupport/test/autoloading_fixtures/throws.rb index 5e47b9699b..e1d96cc512 100644 --- a/activesupport/test/autoloading_fixtures/throws.rb +++ b/activesupport/test/autoloading_fixtures/throws.rb @@ -1,4 +1,4 @@ Throws = 1 -A::B # Autoloading recursion, expected to be discarded. +_ = A::B # Autoloading recursion, expected to be discarded. throw :t -- cgit v1.2.3