mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
fix test for 1.8
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19915 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
3896936492
commit
23ed2fcc31
1 changed files with 6 additions and 3 deletions
|
@ -189,12 +189,13 @@ class CGIMultipartTest < Test::Unit::TestCase
|
|||
@boundary = '----WebKitFormBoundaryAAfvAII+YL9102cX'
|
||||
@data = [
|
||||
{:name=>'hidden1', :value=>'foobar'},
|
||||
{:name=>'text1', :value=>"\xE3\x81\x82\xE3\x81\x84\xE3\x81\x86\xE3\x81\x88\xE3\x81\x8A".force_encoding("UTF-8")},
|
||||
{:name=>'text1', :value=>"\xE3\x81\x82\xE3\x81\x84\xE3\x81\x86\xE3\x81\x88\xE3\x81\x8A"},
|
||||
{:name=>'file1', :value=>_read('file1.html'),
|
||||
:filename=>'file1.html', :content_type=>'text/html'},
|
||||
{:name=>'image1', :value=>_read('small.png'),
|
||||
:filename=>'small.png', :content_type=>'image/png'}, # small image
|
||||
]
|
||||
@data[1][:value].force_encoding("UTF-8") if RUBY_VERSION>="1.9"
|
||||
@expected_class = StringIO
|
||||
_test_multipart()
|
||||
end
|
||||
|
@ -204,12 +205,13 @@ class CGIMultipartTest < Test::Unit::TestCase
|
|||
@boundary = '----WebKitFormBoundaryAAfvAII+YL9102cX'
|
||||
@data = [
|
||||
{:name=>'hidden1', :value=>'foobar'},
|
||||
{:name=>'text1', :value=>"\xE3\x81\x82\xE3\x81\x84\xE3\x81\x86\xE3\x81\x88\xE3\x81\x8A".force_encoding("UTF-8")},
|
||||
{:name=>'text1', :value=>"\xE3\x81\x82\xE3\x81\x84\xE3\x81\x86\xE3\x81\x88\xE3\x81\x8A"},
|
||||
{:name=>'file1', :value=>_read('file1.html'),
|
||||
:filename=>'file1.html', :content_type=>'text/html'},
|
||||
{:name=>'image1', :value=>_read('large.png'),
|
||||
:filename=>'large.png', :content_type=>'image/png'}, # large image
|
||||
]
|
||||
@data[1][:value].force_encoding("UTF-8") if RUBY_VERSION>="1.9"
|
||||
@expected_class = Tempfile
|
||||
_test_multipart()
|
||||
end
|
||||
|
@ -295,12 +297,13 @@ class CGIMultipartTest < Test::Unit::TestCase
|
|||
@boundary = '(.|\n)*'
|
||||
@data = [
|
||||
{:name=>'hidden1', :value=>'foobar'},
|
||||
{:name=>'text1', :value=>"\xE3\x81\x82\xE3\x81\x84\xE3\x81\x86\xE3\x81\x88\xE3\x81\x8A".force_encoding("UTF-8")},
|
||||
{:name=>'text1', :value=>"\xE3\x81\x82\xE3\x81\x84\xE3\x81\x86\xE3\x81\x88\xE3\x81\x8A"},
|
||||
{:name=>'file1', :value=>_read('file1.html'),
|
||||
:filename=>'file1.html', :content_type=>'text/html'},
|
||||
{:name=>'image1', :value=>_read('small.png'),
|
||||
:filename=>'small.png', :content_type=>'image/png'}, # small image
|
||||
]
|
||||
@data[1][:value].force_encoding("UTF-8") if RUBY_VERSION>="1.9"
|
||||
_prepare(@data)
|
||||
cgi = RUBY_VERSION>="1.9" ? CGI.new(:accept_charset=>"UTF-8") : CGI.new
|
||||
assert_equal('file1.html', cgi['file1'].original_filename)
|
||||
|
|
Loading…
Reference in a new issue