Sha256: 93efbdbcfab8a2e634182c18156ca8392349f4928cd261e319f392632cc998f0

Contents?: true

Size: 1.25 KB

Versions: 48

Compression:

Stored size: 1.25 KB

Contents

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

describe "Net::HTTP.newobj" do
  before(:each) do
    @net = Net::HTTP.newobj("127.0.0.1")
  end

  describe "when passed address" do
    it "returns a new Net::HTTP instance" do
      @net.should be_kind_of(Net::HTTP)
    end

    it "sets the new Net::HTTP instance's address to the passed address" do
      @net.address.should == "127.0.0.1"
    end

    it "sets the new Net::HTTP instance's port to the default HTTP port" do
      @net.port.should eql(Net::HTTP.default_port)
    end

    it "does not start the new Net::HTTP instance" do
      @net.started?.should be_false
    end
  end

  describe "when passed address, port" do
    before(:each) do
      @net = Net::HTTP.newobj("127.0.0.1", NetHTTPSpecs.server_port)
    end

    it "returns a new Net::HTTP instance" do
      @net.should be_kind_of(Net::HTTP)
    end

    it "sets the new Net::HTTP instance's address to the passed address" do
      @net.address.should == "127.0.0.1"
    end

    it "sets the new Net::HTTP instance's port to the passed port" do
      @net.port.should eql(NetHTTPSpecs.server_port)
    end

    it "does not start the new Net::HTTP instance" do
      @net.started?.should be_false
    end
  end
end

Version data entries

48 entries across 48 versions & 2 rubygems

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