aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--activesupport/test/autoloading_fixtures/raises_arbitrary_exception.rb1
-rw-r--r--activesupport/test/autoloading_fixtures/throws.rb1
-rw-r--r--activesupport/test/dependencies_test.rb10
3 files changed, 8 insertions, 4 deletions
diff --git a/activesupport/test/autoloading_fixtures/raises_arbitrary_exception.rb b/activesupport/test/autoloading_fixtures/raises_arbitrary_exception.rb
index f980631883..404ae289c6 100644
--- a/activesupport/test/autoloading_fixtures/raises_arbitrary_exception.rb
+++ b/activesupport/test/autoloading_fixtures/raises_arbitrary_exception.rb
@@ -1,3 +1,4 @@
RaisesArbitraryException = 1
+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 55ce509410..5e47b9699b 100644
--- a/activesupport/test/autoloading_fixtures/throws.rb
+++ b/activesupport/test/autoloading_fixtures/throws.rb
@@ -1,3 +1,4 @@
Throws = 1
+A::B # Autoloading recursion, expected to be discarded.
throw :t
diff --git a/activesupport/test/dependencies_test.rb b/activesupport/test/dependencies_test.rb
index dd817af2c5..04e7b24d30 100644
--- a/activesupport/test/dependencies_test.rb
+++ b/activesupport/test/dependencies_test.rb
@@ -272,10 +272,11 @@ class DependenciesTest < ActiveSupport::TestCase
def test_raising_discards_autoloaded_constants
with_autoloading_fixtures do
assert_raises(Exception, 'arbitray exception message') { RaisesArbitraryException }
- assert !Object.const_defined?(:RaisesArbitraryException)
+ assert_not defined?(A)
+ assert_not defined?(RaisesArbitraryException)
end
ensure
- remove_constants(:RaisesArbitraryException)
+ remove_constants(:A, :RaisesArbitraryException)
end
def test_throwing_discards_autoloaded_constants
@@ -283,10 +284,11 @@ class DependenciesTest < ActiveSupport::TestCase
catch :t do
Throws
end
- assert !Object.const_defined?(:Throws)
+ assert_not defined?(A)
+ assert_not defined?(Throws)
end
ensure
- remove_constants(:Throws)
+ remove_constants(:A, :Throws)
end
def test_doesnt_break_normal_require