File: proxy_spec.rb

package info (click to toggle)
gist 6.0.0-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 372 kB
  • sloc: ruby: 3,277; makefile: 16
file content (21 lines) | stat: -rw-r--r-- 525 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
describe '...' do
  before do
    @saved_env = ENV['HTTP_PROXY']
  end

  after do
    ENV['HTTP_PROXY'] = @saved_env
  end

  FOO_URL = URI('http://ddg.gg/')

  xit "should be Net::HTTP when $HTTP_PROXY wasn't set" do
    ENV['HTTP_PROXY'] = ''
    Gist.http_connection(FOO_URL).should be_an_instance_of(Net::HTTP)
  end

  it "should be Net::HTTP::Proxy when $HTTP_PROXY was set" do
    ENV['HTTP_PROXY'] = 'http://proxy.example.com:8080'
    Gist.http_connection(FOO_URL).should_not be_an_instance_of(Net::HTTP)
  end
end