Bug #5840
closedURI::MailTo.build - 2 of 3 examples fail on 1.9.2/1.93
Description
The array examples of URI::MailTo.build in the documentation fail on 1.9
http://www.ruby-doc.org/stdlib-1.9.3/libdoc/uri/rdoc/URI/MailTo.html
ex
ruby-1.9.3-preview1 :003 > m2 = URI::MailTo.build(['john@example.com', [['Subject', 'Ruby'], ['Cc', 'jack@example.com']]])
URI::InvalidComponentError: bad component(expected opaque component): john@example.com?Subject=["Ruby"]&Cc=["jack@example.com"]
from /Users/primerano/Developer/.rvm/rubies/ruby-1.9.3-preview1/lib/ruby/1.9.1/uri/generic.rb:957:in check_opaque' from /Users/primerano/Developer/.rvm/rubies/ruby-1.9.3-preview1/lib/ruby/1.9.1/uri/generic.rb:988:in
opaque='
from /Users/primerano/Developer/.rvm/rubies/ruby-1.9.3-preview1/lib/ruby/1.9.1/uri/generic.rb:198:in initialize' from /Users/primerano/Developer/.rvm/rubies/ruby-1.9.3-preview1/lib/ruby/1.9.1/uri/mailto.rb:135:in
initialize'
from /Users/primerano/Developer/.rvm/rubies/ruby-1.9.3-preview1/lib/ruby/1.9.1/uri/generic.rb:140:in new' from /Users/primerano/Developer/.rvm/rubies/ruby-1.9.3-preview1/lib/ruby/1.9.1/uri/generic.rb:140:in
build'
from /Users/primerano/Developer/.rvm/rubies/ruby-1.9.3-preview1/lib/ruby/1.9.1/uri/mailto.rb:122:in build' from (irb):3 from /Users/primerano/Developer/.rvm/rubies/ruby-1.9.3-preview1/bin/irb:16:in
'
ruby-1.9.3-preview1 :004 > m3 = URI::MailTo.build({:to => 'listman@example.com', :headers => [['subject', 'subscribe']]})
URI::InvalidComponentError: bad component(expected opaque component): listman@example.com?subject=["subscribe"]
from /Users/primerano/Developer/.rvm/rubies/ruby-1.9.3-preview1/lib/ruby/1.9.1/uri/generic.rb:957:in check_opaque' from /Users/primerano/Developer/.rvm/rubies/ruby-1.9.3-preview1/lib/ruby/1.9.1/uri/generic.rb:988:in
opaque='
from /Users/primerano/Developer/.rvm/rubies/ruby-1.9.3-preview1/lib/ruby/1.9.1/uri/generic.rb:198:in initialize' from /Users/primerano/Developer/.rvm/rubies/ruby-1.9.3-preview1/lib/ruby/1.9.1/uri/mailto.rb:135:in
initialize'
from /Users/primerano/Developer/.rvm/rubies/ruby-1.9.3-preview1/lib/ruby/1.9.1/uri/generic.rb:140:in new' from /Users/primerano/Developer/.rvm/rubies/ruby-1.9.3-preview1/lib/ruby/1.9.1/uri/generic.rb:140:in
build'
from /Users/primerano/Developer/.rvm/rubies/ruby-1.9.3-preview1/lib/ruby/1.9.1/uri/mailto.rb:122:in build' from (irb):4 from /Users/primerano/Developer/.rvm/rubies/ruby-1.9.3-preview1/bin/irb:16:in
'
1st example works fine.
ruby-1.9.3-preview1 :005 > m1 = URI::MailTo.build(['joe@example.com', 'subject=Ruby'])
=> #<URI::MailTo:0x007fb75a025918 URL:mailto:joe@example.com?subject=Ruby>