Skip to content

Commit c0ee98c

Browse files
committed
Implement proxy spec
1 parent 47f56c5 commit c0ee98c

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

spec/lib/detect_language_spec.rb

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,15 @@
4646
end
4747
end
4848

49-
xcontext 'with proxy' do
50-
let(:proxy) { 'http://my-proxy:8080' }
49+
context 'with proxy' do
50+
let(:proxy) { 'https://dummy:pass@my-proxy:8080' }
5151

5252
it 'uses the proxy for requests' do
53-
expect { subject }.not_to raise_error
53+
allow(Net::HTTP).to receive(:new)
54+
.with('ws.detectlanguage.com', 443, 'my-proxy', 8080, 'dummy', 'pass', nil, true)
55+
.and_call_original
56+
57+
expect { subject }.to raise_error(Socket::ResolutionError)
5458
end
5559
end
5660
end

0 commit comments

Comments
 (0)