Skip to content
This repository
Browse code

This is for making sure const_missing is triggered without warnings

  • Loading branch information...
commit 4ea1753fc2bcbaca0a50073463ef4b020a2e3c5f 1 parent 514624e
Santiago Pastorino authored July 26, 2010
3  activesupport/test/autoloading_fixtures/loads_constant.rb
... ...
@@ -1,4 +1,5 @@
1 1
 module LoadsConstant
2 2
 end
3 3
 
4  
-RequiresConstant
  4
+# The _ = assignment is to prevent warnings
  5
+_ = RequiresConstant
10  activesupport/test/dependencies_test.rb
@@ -220,11 +220,12 @@ def test_doesnt_break_normal_require
220 220
     $:.push(path)
221 221
 
222 222
     with_autoloading_fixtures do
223  
-      RequiresConstant
  223
+      # The _ = assignments are to prevent warnings
  224
+      _ = RequiresConstant
224 225
       assert defined?(RequiresConstant)
225 226
       assert defined?(LoadedConstant)
226 227
       ActiveSupport::Dependencies.clear
227  
-      RequiresConstant
  228
+      _ = RequiresConstant
228 229
       assert defined?(RequiresConstant)
229 230
       assert defined?(LoadedConstant)
230 231
     end
@@ -241,11 +242,12 @@ def test_doesnt_break_normal_require_nested
241 242
     $:.push(path)
242 243
 
243 244
     with_autoloading_fixtures do
244  
-      LoadsConstant
  245
+      # The _ = assignments are to prevent warnings
  246
+      _ = LoadsConstant
245 247
       assert defined?(LoadsConstant)
246 248
       assert defined?(LoadedConstant)
247 249
       ActiveSupport::Dependencies.clear
248  
-      LoadsConstant
  250
+      _ = LoadsConstant
249 251
       assert defined?(LoadsConstant)
250 252
       assert defined?(LoadedConstant)
251 253
     end

0 notes on commit 4ea1753

Please sign in to comment.
Something went wrong with that request. Please try again.