Sha256: 4c1ad7c5d43cbf16d5e6873fd235d145eac50b27bfaec035c82a88e44262dd7c

Contents?: true

Size: 915 Bytes

Versions: 49

Compression:

Stored size: 915 Bytes

Contents

require File.expand_path('../../../../../spec_helper', __FILE__)
require 'net/http'
require "stringio"

describe "Net::HTTPGenericRequest#body_stream" do
  it "returns self's body stream Object" do
    request = Net::HTTPGenericRequest.new("POST", true, true, "/some/path")
    request.body_stream.should be_nil

    stream = StringIO.new("test")
    request.body_stream = stream
    request.body_stream.should equal(stream)
  end
end

describe "Net::HTTPGenericRequest#body_stream=" do
  before(:each) do
    @request = Net::HTTPGenericRequest.new("POST", true, true, "/some/path")
    @stream = StringIO.new("test")
  end

  it "sets self's body stream to the passed Object" do
    @request.body_stream = @stream
    @request.body_stream.should equal(@stream)
  end

  it "sets self's body to nil" do
    @request.body = "Some Content"
    @request.body_stream = @stream
    @request.body.should be_nil
  end
end

Version data entries

49 entries across 49 versions & 2 rubygems

Version Path
rhodes-7.6.0 spec/framework_spec/app/spec/library/net/http/httpgenericrequest/body_stream_spec.rb
rhodes-7.5.1 spec/framework_spec/app/spec/library/net/http/httpgenericrequest/body_stream_spec.rb
rhodes-7.4.1 spec/framework_spec/app/spec/library/net/http/httpgenericrequest/body_stream_spec.rb
rhodes-7.1.17 spec/framework_spec/app/spec/library/net/http/httpgenericrequest/body_stream_spec.rb
rhodes-6.2.0 spec/framework_spec/app/spec/library/net/http/httpgenericrequest/body_stream_spec.rb
rhodes-6.0.11 spec/framework_spec/app/spec/library/net/http/httpgenericrequest/body_stream_spec.rb
rhodes-5.5.18 spec/framework_spec/app/spec/library/net/http/httpgenericrequest/body_stream_spec.rb
rhodes-5.5.17 spec/framework_spec/app/spec/library/net/http/httpgenericrequest/body_stream_spec.rb
rhodes-5.5.15 spec/framework_spec/app/spec/library/net/http/httpgenericrequest/body_stream_spec.rb
rhodes-5.5.0.22 spec/framework_spec/app/spec/library/net/http/httpgenericrequest/body_stream_spec.rb
rhodes-5.5.2 spec/framework_spec/app/spec/library/net/http/httpgenericrequest/body_stream_spec.rb
rhodes-5.5.0.7 spec/framework_spec/app/spec/library/net/http/httpgenericrequest/body_stream_spec.rb
rhodes-5.5.0.3 spec/framework_spec/app/spec/library/net/http/httpgenericrequest/body_stream_spec.rb
rhodes-5.5.0 spec/framework_spec/app/spec/library/net/http/httpgenericrequest/body_stream_spec.rb
tauplatform-1.0.3 spec/framework_spec/app/spec/library/net/http/httpgenericrequest/body_stream_spec.rb
tauplatform-1.0.2 spec/framework_spec/app/spec/library/net/http/httpgenericrequest/body_stream_spec.rb
tauplatform-1.0.1 spec/framework_spec/app/spec/library/net/http/httpgenericrequest/body_stream_spec.rb
rhodes-3.5.1.12 spec/framework_spec/app/spec/library/net/http/httpgenericrequest/body_stream_spec.rb
rhodes-3.3.5 spec/framework_spec/app/spec/library/net/http/httpgenericrequest/body_stream_spec.rb
rhodes-3.4.2 spec/framework_spec/app/spec/library/net/http/httpgenericrequest/body_stream_spec.rb