@@ -25,7 +25,7 @@ module Remote
25
25
module Http
26
26
describe Default do
27
27
let ( :client ) do
28
- client = Default . new
28
+ client = Default . new
29
29
client . server_url = URI . parse ( 'http://example.com' )
30
30
31
31
client
@@ -52,7 +52,9 @@ module Http
52
52
53
53
describe '#timeout=' do
54
54
let ( :value_set ) { 22 }
55
- before { client . timeout = value_set }
55
+ before do
56
+ expect { client . timeout = value_set } . to output . to_stdout_from_any_process
57
+ end
56
58
57
59
it 'assigns value to #read_timeout' do
58
60
expect ( client . read_timeout ) . to eq value_set
@@ -64,16 +66,16 @@ module Http
64
66
end
65
67
66
68
it 'uses the specified timeout' do
67
- client . timeout = 10
68
- http = client . send :http
69
+ expect { client . timeout = 10 } . to output . to_stdout_from_any_process
70
+ http = client . send :http
69
71
70
72
expect ( http . open_timeout ) . to eq ( 10 )
71
73
expect ( http . read_timeout ) . to eq ( 10 )
72
74
end
73
75
74
76
it 'uses the specified proxy' do
75
77
client . proxy = Proxy . new ( http : 'http://foo:bar@proxy.org:8080' )
76
- http = client . send :http
78
+ http = client . send :http
77
79
78
80
expect ( http ) . to be_proxy
79
81
expect ( http . proxy_address ) . to eq ( 'proxy.org' )
@@ -113,14 +115,14 @@ module Http
113
115
114
116
%w[ no_proxy NO_PROXY ] . each do |no_proxy_var |
115
117
it "honors the #{ no_proxy_var } environment variable when matching" do
116
- with_env ( 'HTTP_PROXY ' => 'proxy.org:8080' , no_proxy_var => 'example.com' ) do
118
+ with_env ( 'http_proxy ' => 'proxy.org:8080' , no_proxy_var => 'example.com' ) do
117
119
http = client . send :http
118
120
expect ( http ) . not_to be_proxy
119
121
end
120
122
end
121
123
122
124
it "ignores the #{ no_proxy_var } environment variable when not matching" do
123
- with_env ( 'HTTP_PROXY ' => 'proxy.org:8080' , no_proxy_var => 'foo.com' ) do
125
+ with_env ( 'http_proxy ' => 'proxy.org:8080' , no_proxy_var => 'foo.com' ) do
124
126
http = client . send :http
125
127
126
128
expect ( http ) . to be_proxy
@@ -130,23 +132,14 @@ module Http
130
132
end
131
133
132
134
it "understands a comma separated list of domains in #{ no_proxy_var } " do
133
- with_env ( 'HTTP_PROXY ' => 'proxy.org:8080' , no_proxy_var => 'example.com,foo.com' ) do
135
+ with_env ( 'http_proxy ' => 'proxy.org:8080' , no_proxy_var => 'example.com,foo.com' ) do
134
136
http = client . send :http
135
137
expect ( http ) . not_to be_proxy
136
138
end
137
139
end
138
140
139
- unless RUBY_VERSION > '2.0' # Ruby 2.0 does its own proxy handling in net/http, which breaks this behaviour
140
- it "understands an asterisk in #{ no_proxy_var } " do
141
- with_env ( 'HTTP_PROXY' => 'proxy.org:8080' , no_proxy_var => '*' ) do
142
- http = client . send :http
143
- expect ( http ) . not_to be_proxy
144
- end
145
- end
146
- end
147
-
148
141
it "understands subnetting in #{ no_proxy_var } " do
149
- with_env ( 'HTTP_PROXY ' => 'proxy.org:8080' , no_proxy_var => 'localhost,127.0.0.0/8' ) do
142
+ with_env ( 'http_proxy ' => 'proxy.org:8080' , no_proxy_var => 'localhost,127.0.0.0/8' ) do
150
143
client . server_url = URI . parse ( 'http://127.0.0.1:4444/wd/hub' )
151
144
152
145
http = client . send :http
0 commit comments