Skip to content
This repository
Browse code

Merge pull request #8424 from kennyj/tiny_fixes_20121206

fix warning: possibly useless use of a constant in void context
  • Loading branch information...
commit 396c0681acab95a58f0583d722f488b5b01398d8 2 parents 6ed4ad1 + 180e2e5
Xavier Noria authored December 05, 2012

Showing 1 changed file with 7 additions and 3 deletions. Show diff stats Hide diff stats

  1. 10  activesupport/test/dependencies_test.rb
10  activesupport/test/dependencies_test.rb
@@ -923,8 +923,10 @@ def test_remove_constant_does_not_trigger_loading_autoloads
923 923
 
924 924
   def test_remove_constant_does_not_autoload_already_removed_parents_as_a_side_effect
925 925
     with_autoloading_fixtures do
926  
-      ::A
927  
-      ::A::B
  926
+      silence_warnings do
  927
+        ::A
  928
+        ::A::B
  929
+      end
928 930
       ActiveSupport::Dependencies.remove_constant('A')
929 931
       ActiveSupport::Dependencies.remove_constant('A::B')
930 932
       assert !defined?(A)
@@ -934,7 +936,9 @@ def test_remove_constant_does_not_autoload_already_removed_parents_as_a_side_eff
934 936
   def test_load_once_constants_should_not_be_unloaded
935 937
     with_autoloading_fixtures do
936 938
       ActiveSupport::Dependencies.autoload_once_paths = ActiveSupport::Dependencies.autoload_paths
937  
-      ::A.to_s
  939
+      silence_warnings do
  940
+        ::A
  941
+      end
938 942
       assert defined?(A)
939 943
       ActiveSupport::Dependencies.clear
940 944
       assert defined?(A)

0 notes on commit 396c068

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