1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activesupport/test/gzip_test.rb

16 lines
536 B
Ruby
Raw Normal View History

2008-06-02 18:42:10 -04:00
require 'abstract_unit'
2011-02-09 05:36:44 -05:00
require 'active_support/core_ext/object/blank'
2008-06-02 18:42:10 -04:00
2012-01-05 20:12:46 -05:00
class GzipTest < ActiveSupport::TestCase
2008-06-02 18:42:10 -04:00
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('')
assert_equal Encoding.find('binary'), compressed.encoding
assert !compressed.blank?, "a compressed blank string should not be blank"
end
2011-02-09 05:36:44 -05:00
end