Sha256: c15a38822f987bc582eb0b8eb1972180e80077f4722000c0b70abaf9b82a7162

Contents?: true

Size: 624 Bytes

Versions: 4

Compression:

Stored size: 624 Bytes

Contents

# encoding: utf-8
require 'fedux_org/stdlib/environment'

module ProxyTester
  module SpecHelper
    module Environment
      include FeduxOrg::Stdlib::Environment
      alias_method :with_environment, :isolated_environment 

      def mock_stdin(&block)
        old_stdin = $stdin
        $stdin = double('stdin')

        block.call
      ensure
        $stdin = old_stdin
      end
    end
  end
end

RSpec.configure do |c|
  c.include ProxyTester::SpecHelper::Environment
  c.before(:suite) do
    %w{
      http_proxy
      https_proxy
      HTTP_PROXY
      HTTPS_PROXY
    }.each { |var| ENV.delete(var) }
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
proxy_tester-0.0.4 spec/support/environment.rb
proxy_tester-0.0.3 spec/support/environment.rb
proxy_tester-0.0.2 spec/support/environment.rb
proxy_tester-0.0.1 spec/support/environment.rb