1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* lib/net/http.rb (each_capitalized): should join header field value. This patch is contributed sheepman [ruby-list:40478]

* test/net/http/test_httpheader.rb: test it.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7701 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
aamine 2005-01-01 08:45:50 +00:00
parent 6a95ae2a79
commit 94402f983f
3 changed files with 16 additions and 1 deletions

View file

@ -1,3 +1,10 @@
Sat Jan 1 17:44:54 2005 Minero Aoki <aamine@loveruby.net>
* lib/net/http.rb (each_capitalized): should join header field
value. This patch is contributed sheepman [ruby-list:40478]
* test/net/http/test_httpheader.rb: test it.
Sat Jan 1 16:21:29 2005 Minero Aoki <aamine@loveruby.net>
* lib/fileutils.rb (copy_stream): use read/write instead of

View file

@ -1138,7 +1138,7 @@ module Net # :nodoc:
# As for #each_header, except the keys are provided in capitalized form.
def each_capitalized
@header.each do |k,v|
yield capitalize(k), v
yield capitalize(k), v.join(', ')
end
end

View file

@ -68,6 +68,14 @@ class HTTPHeaderTest < Test::Unit::TestCase
def test_each_value
end
def test_each_capitalized
@c['my-header'] = ['a', 'b']
@c.each_capitalized do |k,v|
assert_equal 'My-Header', k
assert_equal 'a, b', v
end
end
def test_key?
end