Skip to content

Commit 02aab6d

Browse files
committed
Update tests for keyword args switch
1 parent 7a12aef commit 02aab6d

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

test/test_net_http_persistent.rb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ def test_initialize
177177
end
178178

179179
def test_initialize_name
180-
http = Net::HTTP::Persistent.new 'name'
180+
http = Net::HTTP::Persistent.new name: 'name'
181181
assert_equal 'name', http.name
182182
end
183183

@@ -201,7 +201,7 @@ def test_initialize_no_ssl_session
201201
def test_initialize_proxy
202202
proxy_uri = URI.parse 'http://proxy.example'
203203

204-
http = Net::HTTP::Persistent.new nil, proxy_uri
204+
http = Net::HTTP::Persistent.new proxy: proxy_uri
205205

206206
assert_equal proxy_uri, http.proxy_uri
207207
end
@@ -442,7 +442,7 @@ def test_connection_for_http_class_with_artifice
442442
end
443443

444444
def test_connection_for_name
445-
http = Net::HTTP::Persistent.new 'name'
445+
http = Net::HTTP::Persistent.new name: 'name'
446446
uri = URI.parse 'http://example/'
447447

448448
http.connection_for uri do |c|
@@ -455,7 +455,7 @@ def test_connection_for_proxy
455455
uri.user = 'johndoe'
456456
uri.password = 'muffins'
457457

458-
http = Net::HTTP::Persistent.new nil, uri
458+
http = Net::HTTP::Persistent.new proxy: uri
459459

460460
used = http.connection_for @uri do |c|
461461
assert c.http.started?
@@ -477,7 +477,7 @@ def test_connection_for_proxy_unescaped
477477
uri.password = 'muf%3Afins'
478478
uri.freeze
479479

480-
http = Net::HTTP::Persistent.new nil, uri
480+
http = Net::HTTP::Persistent.new proxy: uri
481481

482482
http.connection_for @uri do end
483483

@@ -495,7 +495,7 @@ def test_connection_for_proxy_host_down
495495
uri.user = 'johndoe'
496496
uri.password = 'muffins'
497497

498-
http = Net::HTTP::Persistent.new nil, uri
498+
http = Net::HTTP::Persistent.new proxy: uri
499499

500500
e = assert_raises Net::HTTP::Persistent::Error do
501501
http.connection_for @uri do end
@@ -511,7 +511,7 @@ def test_connection_for_proxy_refused
511511
uri.user = 'johndoe'
512512
uri.password = 'muffins'
513513

514-
http = Net::HTTP::Persistent.new nil, uri
514+
http = Net::HTTP::Persistent.new proxy: uri
515515

516516
e = assert_raises Net::HTTP::Persistent::Error do
517517
http.connection_for @uri do end
@@ -526,7 +526,7 @@ def test_connection_for_no_proxy
526526
uri.password = 'muffins'
527527
uri.query = 'no_proxy=example.com'
528528

529-
http = Net::HTTP::Persistent.new nil, uri
529+
http = Net::HTTP::Persistent.new proxy: uri
530530

531531
http.connection_for @uri do |c|
532532
assert c.http.started?
@@ -1360,7 +1360,7 @@ def test_shutdown
13601360
c = connection
13611361

13621362
orig = @http
1363-
@http = Net::HTTP::Persistent.new 'name'
1363+
@http = Net::HTTP::Persistent.new name: 'name'
13641364
c2 = connection
13651365

13661366
orig.shutdown

0 commit comments

Comments
 (0)