Sha256: a33683ff5ea474ffef6880f13da7bcf8ebca1b5df86f503825d4c1c35a8f1ed8

Contents?: true

Size: 775 Bytes

Versions: 3

Compression:

Stored size: 775 Bytes

Contents

describe :net_httpheader_set_content_type, :shared => true do
  describe "when passed type, params" do
    before(:each) do
      @headers = NetHTTPHeaderSpecs::Example.new
    end

    it "sets the 'Content-Type' header entry based on the passed type and params" do
      @headers.send(@method, "text/html")
      @headers["Content-Type"].should == "text/html"

      @headers.send(@method, "text/html", "charset" => "utf-8")
      @headers["Content-Type"].should == "text/html; charset=utf-8"

      @headers.send(@method, "text/html", "charset" => "utf-8", "rubyspec" => "rocks")
      @headers["Content-Type"].should =~ %r[text/html]
      @headers["Content-Type"].should =~ %r[charset=utf-8]
      @headers["Content-Type"].should =~ %r[rubyspec=rocks]
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rubysl-net-http-1.0.1 spec/httpheader/shared/set_content_type.rb
rubysl-net-http-2.0.4 spec/httpheader/shared/set_content_type.rb
rubysl-net-http-1.0.0 spec/httpheader/shared/set_content_type.rb