mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
parent
d54de0808c
commit
52ce6ece8c
2 changed files with 14 additions and 0 deletions
3
activesupport/test/autoloading_fixtures/throws.rb
Normal file
3
activesupport/test/autoloading_fixtures/throws.rb
Normal file
|
@ -0,0 +1,3 @@
|
|||
Throws = 1
|
||||
|
||||
throw :t
|
|
@ -269,6 +269,17 @@ class DependenciesTest < ActiveSupport::TestCase
|
|||
remove_constants(:ModuleFolder)
|
||||
end
|
||||
|
||||
def test_throwing_removes_autoloaded_constants
|
||||
with_autoloading_fixtures do
|
||||
catch :t do
|
||||
Throws
|
||||
end
|
||||
assert !Object.const_defined?(:Throws)
|
||||
end
|
||||
ensure
|
||||
remove_constants(:Throws)
|
||||
end
|
||||
|
||||
def test_doesnt_break_normal_require
|
||||
path = File.expand_path("../autoloading_fixtures/load_path", __FILE__)
|
||||
original_path = $:.dup
|
||||
|
|
Loading…
Reference in a new issue