diff options
author | Josh Kalderimis <josh.kalderimis@gmail.com> | 2011-02-09 10:23:45 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2011-02-09 10:27:01 +0100 |
commit | 3eb25fb8806c0b161d2d1d9cb22d0bdfc7b0ce63 (patch) | |
tree | 24d88b4619c4c8d2f7a1fd23e6dbb3ad6b9297d7 /activesupport/test/gzip_test.rb | |
parent | 5046120b97f4ce8ab08ff7e65c87cfb35f95dba6 (diff) | |
download | rails-3eb25fb8806c0b161d2d1d9cb22d0bdfc7b0ce63.tar.gz rails-3eb25fb8806c0b161d2d1d9cb22d0bdfc7b0ce63.tar.bz2 rails-3eb25fb8806c0b161d2d1d9cb22d0bdfc7b0ce63.zip |
fix for AS Gzip returning a UTF-8 string in Ruby 1.9 when it is actually binary [#6386 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'activesupport/test/gzip_test.rb')
-rw-r--r-- | activesupport/test/gzip_test.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/activesupport/test/gzip_test.rb b/activesupport/test/gzip_test.rb index 2a24c0bd0d..6adfab0359 100644 --- a/activesupport/test/gzip_test.rb +++ b/activesupport/test/gzip_test.rb @@ -4,4 +4,14 @@ class GzipTest < Test::Unit::TestCase def test_compress_should_decompress_to_the_same_value assert_equal "Hello World", ActiveSupport::Gzip.decompress(ActiveSupport::Gzip.compress("Hello World")) end + + def test_compress_should_return_a_binary_string + compressed = ActiveSupport::Gzip.compress('') + + if "".encoding_aware? + assert_equal Encoding.find('binary'), compressed.encoding + end + + assert !compressed.blank?, "a compressed blank string should not be blank" + end end
\ No newline at end of file |