aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template/output_buffer_test.rb
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2009-05-28 16:56:09 -0500
committerJeremy Kemper <jeremy@bitsweat.net>2009-05-28 17:12:48 -0500
commite23554d79e2db2324144f3ab58f82a895b93fbf5 (patch)
tree35b715035f77d0488294f930ad42dece27076035 /actionpack/test/template/output_buffer_test.rb
parentd120f9de7e150ea6a5f21c834c1f1d0a9ea25d1a (diff)
downloadrails-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/template/output_buffer_test.rb')
-rw-r--r--actionpack/test/template/output_buffer_test.rb11
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