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

Silence warnings here, only setting Encoding.default_external for testing.

This commit is contained in:
Emilio Tagua 2010-09-28 18:10:32 -03:00
parent 523f98099d
commit d1e976da7f

View file

@ -319,10 +319,11 @@ class LazyViewRenderTest < ActiveSupport::TestCase
end
def with_external_encoding(encoding)
old, Encoding.default_external = Encoding.default_external, encoding
old = Encoding.default_external
silence_warnings { Encoding.default_external = encoding }
yield
ensure
Encoding.default_external = old
silence_warnings { Encoding.default_external = old }
end
end
end