diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2009-05-28 16:56:09 -0500 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2009-05-28 17:12:48 -0500 |
commit | e23554d79e2db2324144f3ab58f82a895b93fbf5 (patch) | |
tree | 35b715035f77d0488294f930ad42dece27076035 /actionpack/test | |
parent | d120f9de7e150ea6a5f21c834c1f1d0a9ea25d1a (diff) | |
download | rails-e23554d79e2db2324144f3ab58f82a895b93fbf5.tar.gz rails-e23554d79e2db2324144f3ab58f82a895b93fbf5.tar.bz2 rails-e23554d79e2db2324144f3ab58f82a895b93fbf5.zip |
Ruby 1.9: flushing the output buffer preserves its encoding
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/template/output_buffer_test.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/actionpack/test/template/output_buffer_test.rb b/actionpack/test/template/output_buffer_test.rb index f1df1c7a60..36bbaf9099 100644 --- a/actionpack/test/template/output_buffer_test.rb +++ b/actionpack/test/template/output_buffer_test.rb @@ -38,6 +38,17 @@ class OutputBufferTest < ActionController::TestCase assert_equal ['foo', 'bar'], body_parts end + if '1.9'.respond_to?(:force_encoding) + test 'flushing preserves output buffer encoding' do + original_buffer = ' '.force_encoding(Encoding::EUC_JP) + @controller.template.output_buffer = original_buffer + @controller.template.flush_output_buffer + assert_equal ['foo', original_buffer], body_parts + assert_not_equal original_buffer, output_buffer + assert_equal Encoding::EUC_JP, output_buffer.encoding + end + end + protected def output_buffer @controller.template.output_buffer |