aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/gzip_test.rb
blob: 6adfab035976241c33e47f358fe79b3a987ac6ef (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
require 'abstract_unit'

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