From 4278f88e5faa8e733409bb4256a01cc510f87570 Mon Sep 17 00:00:00 2001 From: Dan DeBruler Date: Tue, 28 Dec 2021 13:33:54 -0500 Subject: Return output stream in binmode --- test/tc_package.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'test') diff --git a/test/tc_package.rb b/test/tc_package.rb index f1ce0421..8dea7ccf 100644 --- a/test/tc_package.rb +++ b/test/tc_package.rb @@ -303,6 +303,8 @@ class TestPackage < Test::Unit::TestCase # this is just a roundabout guess for a package as it is build now # in testing. assert(stream.size > 80000) + # Stream (of zipped contents) should have appropriate default encoding + assert_equal(stream.external_encoding, Encoding::ASCII_8BIT) # Cached ids should be cleared assert(Axlsx::Relationship.ids_cache.empty?) end -- cgit v1.2.3 From 7f4045fc69683d51c7c3fbd6497cfadba4966484 Mon Sep 17 00:00:00 2001 From: Dan DeBruler Date: Fri, 21 Jan 2022 10:53:37 -0500 Subject: Check string encoding for validity _and_ value --- test/tc_package.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'test') diff --git a/test/tc_package.rb b/test/tc_package.rb index 8dea7ccf..b98fa2f0 100644 --- a/test/tc_package.rb +++ b/test/tc_package.rb @@ -304,6 +304,7 @@ class TestPackage < Test::Unit::TestCase # in testing. assert(stream.size > 80000) # Stream (of zipped contents) should have appropriate default encoding + assert stream.string.valid_encoding? assert_equal(stream.external_encoding, Encoding::ASCII_8BIT) # Cached ids should be cleared assert(Axlsx::Relationship.ids_cache.empty?) -- cgit v1.2.3