Sha256: fd454bdf20b0a52655f4083288d62004f704c51ea4c49b2e323d8a89258b8c92

Contents?: true

Size: 731 Bytes

Versions: 49

Compression:

Stored size: 731 Bytes

Contents

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

ruby_version_is ''...'1.9.3' do
  describe "Net::HTTPResponse#to_ary" do
    before(:each) do
      @res = Net::HTTPUnknownResponse.new("1.0", "???", "test response")

      socket = Net::BufferedIO.new(StringIO.new("test body"))
      @res.reading_body(socket, true) {}
    end

    it "returns an Array containing a duplicate of self and self's body" do
      ary = @res.to_ary
      ary.size.should == 2

      ary[0].inspect.should == @res.inspect
      ary[1].should == "test body"
    end

    it "removes #to_ary from the duplicate of self" do
      @res.to_ary[0].respond_to?(:to_ary).should be_false
    end
  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/httpresponse/to_ary_spec.rb
rhodes-7.5.1 spec/framework_spec/app/spec/library/net/http/httpresponse/to_ary_spec.rb
rhodes-7.4.1 spec/framework_spec/app/spec/library/net/http/httpresponse/to_ary_spec.rb
rhodes-7.1.17 spec/framework_spec/app/spec/library/net/http/httpresponse/to_ary_spec.rb
rhodes-6.2.0 spec/framework_spec/app/spec/library/net/http/httpresponse/to_ary_spec.rb
rhodes-6.0.11 spec/framework_spec/app/spec/library/net/http/httpresponse/to_ary_spec.rb
rhodes-5.5.18 spec/framework_spec/app/spec/library/net/http/httpresponse/to_ary_spec.rb
rhodes-5.5.17 spec/framework_spec/app/spec/library/net/http/httpresponse/to_ary_spec.rb
rhodes-5.5.15 spec/framework_spec/app/spec/library/net/http/httpresponse/to_ary_spec.rb
rhodes-5.5.0.22 spec/framework_spec/app/spec/library/net/http/httpresponse/to_ary_spec.rb
rhodes-5.5.2 spec/framework_spec/app/spec/library/net/http/httpresponse/to_ary_spec.rb
rhodes-5.5.0.7 spec/framework_spec/app/spec/library/net/http/httpresponse/to_ary_spec.rb
rhodes-5.5.0.3 spec/framework_spec/app/spec/library/net/http/httpresponse/to_ary_spec.rb
rhodes-5.5.0 spec/framework_spec/app/spec/library/net/http/httpresponse/to_ary_spec.rb
tauplatform-1.0.3 spec/framework_spec/app/spec/library/net/http/httpresponse/to_ary_spec.rb
tauplatform-1.0.2 spec/framework_spec/app/spec/library/net/http/httpresponse/to_ary_spec.rb
tauplatform-1.0.1 spec/framework_spec/app/spec/library/net/http/httpresponse/to_ary_spec.rb
rhodes-3.5.1.12 spec/framework_spec/app/spec/library/net/http/httpresponse/to_ary_spec.rb
rhodes-3.3.5 spec/framework_spec/app/spec/library/net/http/httpresponse/to_ary_spec.rb
rhodes-3.4.2 spec/framework_spec/app/spec/library/net/http/httpresponse/to_ary_spec.rb