summaryrefslogtreecommitdiff
path: root/test/cgi/test_cgi_multipart.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/cgi/test_cgi_multipart.rb')
-rwxr-xr-xtest/cgi/test_cgi_multipart.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/test/cgi/test_cgi_multipart.rb b/test/cgi/test_cgi_multipart.rb
index 34f077e9c5..47a41f6488 100755
--- a/test/cgi/test_cgi_multipart.rb
+++ b/test/cgi/test_cgi_multipart.rb
@@ -135,7 +135,11 @@ class CGIMultipartTest < Test::Unit::TestCase
ENV['CONTENT_LENGTH'] = input.length.to_s
ENV['REQUEST_METHOD'] = 'POST'
## set $stdin
- tmpfile = Tempfile.new(self.name, :binmode => true)
+ tmpfile = if RUBY_VERSION >="1.9"
+ Tempfile.new(self.name, :binmode => true)
+ else
+ Tempfile.new(self.name)
+ end
tmpfile << input
tmpfile.rewind()
$stdin = tmpfile