Sha256: 1e1c626e2fac72774fb11771c097dd712ead296ecc05b13d636235d8a4de5909

Contents?: true

Size: 852 Bytes

Versions: 3

Compression:

Stored size: 852 Bytes

Contents

# -*- encoding : utf-8 -*-
module Pacto
  describe Extensions do
    describe '#normalize_header_keys' do
      it 'matches headers to the style in the RFC documentation' do
        expect(Pacto::Extensions.normalize_header_keys(:'user-agent' => 'a')).to eq('User-Agent' => 'a') # rubocop:disable SymbolName
        expect(Pacto::Extensions.normalize_header_keys(user_agent: 'a')).to eq('User-Agent' => 'a')
        expect(Pacto::Extensions.normalize_header_keys('User-Agent' => 'a')).to eq('User-Agent' => 'a')
        expect(Pacto::Extensions.normalize_header_keys('user-agent' => 'a')).to eq('User-Agent' => 'a')
        expect(Pacto::Extensions.normalize_header_keys('user_agent' => 'a')).to eq('User-Agent' => 'a')
        expect(Pacto::Extensions.normalize_header_keys('USER_AGENT' => 'a')).to eq('User-Agent' => 'a')
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
pacto-0.4.0.rc3 spec/unit/pacto/extensions_spec.rb
pacto-0.4.0.rc2 spec/unit/pacto/extensions_spec.rb
pacto-0.4.0.rc1 spec/unit/pacto/extensions_spec.rb