1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Reset callbacks after test.

Otherwise the state of callback chain is leaked.
This commit is contained in:
Zuhao Wan 2014-06-05 22:30:53 +08:00
parent 1c39310637
commit 5faf77fe7a

View file

@ -3,6 +3,11 @@ require 'abstract_unit'
class ReloaderTest < ActiveSupport::TestCase
Reloader = ActionDispatch::Reloader
teardown do
Reloader.reset_callbacks :prepare
Reloader.reset_callbacks :cleanup
end
def test_prepare_callbacks
a = b = c = nil
Reloader.to_prepare { |*args| a = b = c = 1 }