diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-07-24 00:24:12 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-07-24 00:26:28 +0900 |
commit | c9826c20d204d4b8894e6fd51e5913959676776d (patch) | |
tree | 36f7460fc0d35a98c6f0caaef91ee9a4b8e7597b /test/net | |
parent | 325f7b6008a4a10e9b0f1c69ee4518b0669461be (diff) | |
download | ruby-c9826c20d204d4b8894e6fd51e5913959676776d.tar.gz |
Show the caller's location
* lib/net/http/header.rb: show the caller's location instead of
the current lines.
Diffstat (limited to 'test/net')
-rw-r--r-- | test/net/http/test_httpheader.rb | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/test/net/http/test_httpheader.rb b/test/net/http/test_httpheader.rb index cb4678a805..cfbe36bcfd 100644 --- a/test/net/http/test_httpheader.rb +++ b/test/net/http/test_httpheader.rb @@ -119,7 +119,19 @@ class HTTPHeaderTest < Test::Unit::TestCase class D; include Net::HTTPHeader; end def test_nil_variable_header - assert_nothing_raised { D.new.initialize_http_header({Authorization: nil}) } + assert_nothing_raised do + assert_warning("#{__FILE__}:#{__LINE__+1}: warning: net/http: nil HTTP header: Authorization\n") do + D.new.initialize_http_header({Authorization: nil}) + end + end + end + + def test_duplicated_variable_header + assert_nothing_raised do + assert_warning("#{__FILE__}:#{__LINE__+1}: warning: net/http: duplicated HTTP header: Authorization\n") do + D.new.initialize_http_header({"AUTHORIZATION": "yes", "Authorization": "no"}) + end + end end def test_delete |