@@ -59,7 +59,7 @@ class TestWebApi < Test::Unit::TestCase
5959
6060 should 'load data from the Steam Community Web API' do
6161 data = mock read : 'data'
62- Community ::WebApi . expects ( :open ) . with do |url , options |
62+ Community ::URI . expects ( :open ) . with do |url , options |
6363 options == { proxy : true , 'Content-Type' => 'application/x-www-form-urlencoded' } &&
6464 url . start_with? ( 'https://api.steampowered.com/interface/method/v2/?' ) &&
6565 ( url . split ( '?' ) . last . split ( '&' ) & %w{ test=param format=json key=0123456789ABCDEF0123456789ABCDEF } ) . size == 3
@@ -72,7 +72,7 @@ class TestWebApi < Test::Unit::TestCase
7272 Community ::WebApi . api_key = nil
7373
7474 data = mock read : 'data'
75- Community ::WebApi . expects ( :open ) . with do |url , options |
75+ Community ::URI . expects ( :open ) . with do |url , options |
7676 options == { proxy : true , 'Content-Type' => 'application/x-www-form-urlencoded' } &&
7777 url . start_with? ( 'https://api.steampowered.com/interface/method/v2/?' ) &&
7878 ( url . split ( '?' ) . last . split ( '&' ) & %w{ test=param format=json } ) . size == 2
@@ -84,7 +84,7 @@ class TestWebApi < Test::Unit::TestCase
8484 should 'handle unauthorized access error when loading data' do
8585 io = mock status : [ 401 ]
8686 http_error = OpenURI ::HTTPError . new '' , io
87- Community ::WebApi . expects ( :open ) . raises http_error
87+ Community ::URI . expects ( :open ) . raises http_error
8888
8989 error = assert_raises Error ::WebApi do
9090 Community ::WebApi . get :json , 'interface' , 'method' , 2 , test : 'param'
@@ -95,7 +95,7 @@ class TestWebApi < Test::Unit::TestCase
9595 should 'handle generic HTTP errors when loading data' do
9696 io = mock status : [ [ 404 , 'Not found' ] ]
9797 http_error = OpenURI ::HTTPError . new '' , io
98- Community ::WebApi . expects ( :open ) . raises http_error
98+ Community ::URI . expects ( :open ) . raises http_error
9999
100100 error = assert_raises Error ::WebApi do
101101 Community ::WebApi . get :json , 'interface' , 'method' , 2 , test : 'param'
@@ -107,7 +107,7 @@ class TestWebApi < Test::Unit::TestCase
107107 Community ::WebApi . secure = false
108108
109109 data = mock read : 'data'
110- Community ::WebApi . expects ( :open ) . with do |url , options |
110+ Community ::URI . expects ( :open ) . with do |url , options |
111111 options == { proxy : true , 'Content-Type' => 'application/x-www-form-urlencoded' } &&
112112 url . start_with? ( 'http://api.steampowered.com/interface/method/v2/?' ) &&
113113 ( url . split ( '?' ) . last . split ( '&' ) & %w{ test=param format=json key=0123456789ABCDEF0123456789ABCDEF } ) . size == 3
0 commit comments