summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-06-29 03:59:00 -0700
committerEric Wong <normalperson@yhbt.net>2009-06-29 04:07:01 -0700
commitcfed47020a39291504877ce2a3463ed268fed9c8 (patch)
tree76783464e48a3742922f6abf19e10104aea5e9c1
parent0127374ed2e4028ca8e164c2cfba357b53960a10 (diff)
Now that I've beefed out my Makefile to detect errors,
I've noticed this test has been failing under 1.9 for
a while now.  Currently no released version of Rack(1.0)
or Rails(2.3.2.1) supports this.
-rw-r--r--test/rails/test_rails.rb30
1 files changed, 18 insertions, 12 deletions
diff --git a/test/rails/test_rails.rb b/test/rails/test_rails.rb
index c7add20..e6f6a36 100644
--- a/test/rails/test_rails.rb
+++ b/test/rails/test_rails.rb
@@ -142,18 +142,24 @@ logger Logger.new('#{COMMON_TMP.path}')
         end
       end
     end
-    resp = `curl -isSfN -Ffile=@#{tmp.path} http://#@addr:#@port/foo/xpost`
-    assert $?.success?
-    resp = resp.split(/\r?\n/)
-    grepped = resp.grep(/^sha1: (.{40})/)
-    assert_equal 1, grepped.size
-    assert_equal(sha1.hexdigest, /^sha1: (.{40})/.match(grepped.first)[1])
-
-    grepped = resp.grep(/^Content-Type:\s+(.+)/i)
-    assert_equal 1, grepped.size
-    assert_match %r{^text/plain}, grepped.first.split(/\s*:\s*/)[1]
-
-    assert_equal 1, resp.grep(/^Status:/i).size
+
+    # fixed in Rack commit 44ed4640f077504a49b7f1cabf8d6ad7a13f6441,
+    # no released version of Rails or Rack has this fix
+    if RB_V[0] >= 1 && RB_V[1] >= 9
+      warn "multipart broken with Rack 1.0.0 and Rails 2.3.2.1 under 1.9"
+    else
+      resp = `curl -isSfN -Ffile=@#{tmp.path} http://#@addr:#@port/foo/xpost`
+      assert $?.success?
+      resp = resp.split(/\r?\n/)
+      grepped = resp.grep(/^sha1: (.{40})/)
+      assert_equal 1, grepped.size
+      assert_equal(sha1.hexdigest, /^sha1: (.{40})/.match(grepped.first)[1])
+
+      grepped = resp.grep(/^Content-Type:\s+(.+)/i)
+      assert_equal 1, grepped.size
+      assert_match %r{^text/plain}, grepped.first.split(/\s*:\s*/)[1]
+      assert_equal 1, resp.grep(/^Status:/i).size
+    end
 
     # make sure we can get 403 responses, too
     uri = URI.parse("http://#@addr:#@port/foo/xpost")