Sha256: 0c13f7e0ffdd6a34a6e1c9faac5622c35bd8ca2f3672f1927a7649b00e1b6805
Contents?: true
Size: 1.06 KB
Versions: 52
Compression:
Stored size: 1.06 KB
Contents
require 'volt/server/rack/http_response_header' describe Volt::HttpResponseHeader do it 'it should headerize the keys' do header = Volt::HttpResponseHeader.new header[:content_type] = 'test' expect(header['Content-Type']).to eq('test') expect(header['content-type']).to eq('test') expect(header['content_type']).to eq('test') expect(header[:content_type]).to eq('test') expect(header.keys).to eq(['Content-Type']) end it 'should delete keys' do header = Volt::HttpResponseHeader.new header[:content_type] = 'test' expect(header.delete(:content_type)).to eq('test') expect(header.size).to eq 0 end it 'should merge other plain hashes and headerize their keys' do header = Volt::HttpResponseHeader.new header[:content_type] = 'test' hash = {} hash[:transfer_encoding] = 'encoding' expect(header.merge(hash)).to be_a(Volt::HttpResponseHeader) expect(header.merge(hash)['Transfer-Encoding']).to eq('encoding') header.merge!(hash) expect(header['Transfer-Encoding']).to eq('encoding') end end
Version data entries
52 entries across 52 versions & 1 rubygems