From d6f0bd2b8423807755bae05a388625a8ef6e7e04 Mon Sep 17 00:00:00 2001 From: hsbt Date: Fri, 8 Aug 2014 10:30:19 +0000 Subject: [PATCH] * lib/open-uri.rb: remove needless condition for old ruby version. * test/open-uri/test_open-uri.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47103 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ lib/open-uri.rb | 3 +-- test/open-uri/test_open-uri.rb | 4 +--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 79584684e9..14881a0a4d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Fri Aug 8 17:19:57 2014 SHIBATA Hiroshi + + * lib/open-uri.rb: remove needless condition for old ruby version. + * test/open-uri/test_open-uri.rb: ditto. + Fri Aug 8 16:40:59 2014 SHIBATA Hiroshi * lib/irb/init.rb: removed unreachable code. diff --git a/lib/open-uri.rb b/lib/open-uri.rb index f9822a9847..b793828063 100644 --- a/lib/open-uri.rb +++ b/lib/open-uri.rb @@ -256,8 +256,7 @@ module OpenURI raise "Non-HTTP proxy URI: #{proxy_uri}" if proxy_uri.class != URI::HTTP end - if target.userinfo && "1.9.0" <= RUBY_VERSION - # don't raise for 1.8 because compatibility. + if target.userinfo raise ArgumentError, "userinfo not supported. [RFC3986]" end diff --git a/test/open-uri/test_open-uri.rb b/test/open-uri/test_open-uri.rb index ff7fc3376e..4073754bd7 100644 --- a/test/open-uri/test_open-uri.rb +++ b/test/open-uri/test_open-uri.rb @@ -401,9 +401,7 @@ class TestOpenURI < Test::Unit::TestCase end def test_userinfo - if "1.9.0" <= RUBY_VERSION - assert_raise(ArgumentError) { open("http://user:pass@127.0.0.1/") {} } - end + assert_raise(ArgumentError) { open("http://user:pass@127.0.0.1/") {} } end def test_progress