Restore settings even if a test failure occurs.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5227 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2011-03-27 15:41:05 +00:00
parent 4f9d3f80c4
commit 3ef5daaf35
1 changed files with 1 additions and 0 deletions

View File

@ -87,6 +87,7 @@ class ActiveSupport::TestCase
saved_settings = options.keys.inject({}) {|h, k| h[k] = Setting[k].dup; h}
options.each {|k, v| Setting[k] = v}
yield
ensure
saved_settings.each {|k, v| Setting[k] = v}
end