summaryrefslogtreecommitdiff
path: root/spec/ruby/library/net-http/httpgenericrequest/request_body_permitted_spec.rb
blob: 1713b59baf5c4699a1b3cd737b1b35cc6f443555 (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