Sha256: 6d1f50e7f5561cadb9b2b3c0dabcd041344df3d3cdedaa55da08a1c808ba2038

Contents?: true

Size: 1.05 KB

Versions: 15

Compression:

Stored size: 1.05 KB

Contents

shared_context :http_proxy_rules do
  let(:hop_header_1) { 'hop-header-1' }
  let(:hop_header_2) { 'hop-header-2' }

  let(:prohibited_headers) do
    { 'connection' => [hop_header_1, hop_header_2].join(','),
      'keep-alive' => 'something',
      'proxy-authenticate' => 'something',
      'proxy-authorization' => 'something',
      'te' => 'something',
      'trailers' => 'something',
      'transfer-encoding' => 'something',
      'content-encoding' => 'something',
      'proxy-connection' => 'something',
      hop_header_1 => 'value',
      hop_header_2 => 'value' }
  end

  RSpec::Matchers.define :have_prohibitted_headers do
    match do |http_headers|
      http_headers.any? do |header_name, _value|
        prohibited_headers.key?(header_name.downcase)
      end
    end
  end

  RSpec::Matchers.define :include_headers do |*expected|
    match do |http_headers|
      actual_headers = http_headers.keys.collect(&:downcase)

      expected.collect(&:to_s).all? do |header_name|
        actual_headers.include?(header_name.downcase)
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
sitehub-0.5.0.alpha12 spec/support/shared_contexts/http_proxy_rules_context.rb
sitehub-0.4.10 spec/support/shared_contexts/http_proxy_rules_context.rb
sitehub-0.5.0.alpha11 spec/support/shared_contexts/http_proxy_rules_context.rb
sitehub-0.5.0.alpha10 spec/support/shared_contexts/http_proxy_rules_context.rb
sitehub-0.5.0.alpha8 spec/support/shared_contexts/http_proxy_rules_context.rb
sitehub-0.5.0.alpha7 spec/support/shared_contexts/http_proxy_rules_context.rb
sitehub-0.5.0.alpha6 spec/support/shared_contexts/http_proxy_rules_context.rb
sitehub-0.5.0.alpha5 spec/support/shared_contexts/http_proxy_rules_context.rb
sitehub-0.5.0.alpha4 spec/support/shared_contexts/http_proxy_rules_context.rb
sitehub-0.5.0.alpha3 spec/support/shared_contexts/http_proxy_rules_context.rb
sitehub-0.5.0.alpha2 spec/support/shared_contexts/http_proxy_rules_context.rb
sitehub-0.4.9 spec/support/shared_contexts/http_proxy_rules_context.rb
sitehub-0.4.8 spec/support/shared_contexts/http_proxy_rules_context.rb
sitehub-0.4.7 spec/support/shared_contexts/http_proxy_rules_context.rb
sitehub-0.4.6 spec/support/shared_contexts/http_proxy_rules_context.rb