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:
parent
523f98099d
commit
d1e976da7f
1 changed files with 3 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue