about summary refs log tree commit homepage
path: root/test/test_extras_try_gzip_static.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_extras_try_gzip_static.rb')
-rw-r--r--test/test_extras_try_gzip_static.rb25
1 files changed, 15 insertions, 10 deletions
diff --git a/test/test_extras_try_gzip_static.rb b/test/test_extras_try_gzip_static.rb
index 4d20b5a..60129df 100644
--- a/test/test_extras_try_gzip_static.rb
+++ b/test/test_extras_try_gzip_static.rb
@@ -48,6 +48,8 @@ class TestExtrasTryGzipStatic < Testcase
 
     begin # setup
       gpl = "#{tmpdir}/COPYING"
+      File.symlink gpl, "#{tmpdir}/COPYING.abssymlink"
+      File.symlink "COPYING", "#{tmpdir}/COPYING.relsymlink"
       gplgz = "#{tmpdir}/COPYING.gz"
       FileUtils.cp("COPYING", gpl)
       _, status = Process.waitpid2(fork do
@@ -88,16 +90,19 @@ class TestExtrasTryGzipStatic < Testcase
         when "HEAD" then assert_nil body
         end
 
-        req = "#{m} /COPYING HTTP/1.0\r\nAccept-Encoding: gzip"
-        body = check.call(req) do |head|
-          assert_match %r{^Content-Encoding: gzip\b}, head
-          assert_match %r{^Content-Type: text/plain\b}, head
-          assert_match %r{^Content-Length: #{gz_st.size}\b}, head
-        end
-        case m
-        when "GET"
-          assert_equal GPL_TEXT, Zlib::GzipReader.new(StringIO.new(body)).read
-        when "HEAD" then assert_nil body
+        %w(COPYING COPYING.abssymlink COPYING.relsymlink).each do |path|
+          req = "#{m} /#{path} HTTP/1.0\r\nAccept-Encoding: gzip"
+          body = check.call(req) do |head|
+            assert_match %r{^Content-Encoding: gzip\b}, head
+            assert_match %r{^Content-Type: text/plain\b}, head
+            assert_match %r{^Content-Length: #{gz_st.size}\b}, head
+          end
+          case m
+          when "GET"
+            body =StringIO.new(body)
+            assert_equal GPL_TEXT, Zlib::GzipReader.new(body).read
+          when "HEAD" then assert_nil body
+          end
         end
       end
     end