Sha256: 4696df25ae8a5677ee08588a1e1e9cb6038f155e9da9290d8e0d45fc5e4c59e0

Contents?: true

Size: 948 Bytes

Versions: 10

Compression:

Stored size: 948 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')

describe WebMock::Util::Headers do

  it "should decode_userinfo_from_header handles basic auth" do
    authorization_header = "Basic dXNlcm5hbWU6c2VjcmV0"
    userinfo = Util::Headers.decode_userinfo_from_header(authorization_header)
    userinfo.should == "username:secret"
  end

  describe "sorted_headers_string" do
    
    it "should return nice string for hash with string values" do
      Util::Headers.sorted_headers_string({"a" => "b"}).should == "{'A'=>'b'}"
    end
    
    it "should return nice string for hash with array values" do
      Util::Headers.sorted_headers_string({"a" => ["b", "c"]}).should == "{'A'=>['b', 'c']}"
    end
  
    it "should return nice string for hash with array values and string values" do
      Util::Headers.sorted_headers_string({"a" => ["b", "c"], "d" => "e"}).should == "{'A'=>['b', 'c'], 'D'=>'e'}"
    end
    
  
  end

end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
webmock-1.3.5 spec/util/headers_spec.rb
webmock-1.3.4 spec/util/headers_spec.rb
webmock-1.3.3 spec/util/headers_spec.rb
webmock-1.3.2 spec/util/headers_spec.rb
webmock-1.3.1 spec/util/headers_spec.rb
webmock-1.3.0 spec/util/headers_spec.rb
webmock-1.2.2 spec/util/headers_spec.rb
webmock-1.2.1 spec/util/headers_spec.rb
webmock-1.2.0 spec/util/headers_spec.rb
webmock-1.1.0 spec/util/headers_spec.rb