summaryrefslogtreecommitdiff
path: root/spec/ruby/library/net/http/httpgenericrequest/request_body_permitted_spec.rb
blob: 50cd1ff637b5faff182942a371145bbd0e97be57 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
require_relative '../../../../spec_helper'
require 'net/http'

describe "Net::HTTPGenericRequest#request_body_permitted?" do
  it "returns true when the request is expected to have a body" do
    request = Net::HTTPGenericRequest.new("POST", true, true, "/some/path")
    request.request_body_permitted?.should be_true

    request = Net::HTTPGenericRequest.new("POST", false, true, "/some/path")
    request.request_body_permitted?.should be_false
  end
end