Sha256: 44c6cccba50704b1e3015471467f6d8f9df160fac668d935b9ef83897c4583f6
Contents?: true
Size: 1.23 KB
Versions: 48
Compression:
Stored size: 1.23 KB
Contents
require File.expand_path('../../../../../spec_helper', __FILE__) require 'net/http' describe "Net::HTTP#initialize" do it "is private" do Net::HTTP.should have_private_instance_method(:initialize) end describe "when passed address" do before(:each) do @net = Net::HTTP.allocate @net.send(:initialize, "127.0.0.1") 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.allocate @net.send(:initialize, "127.0.0.1", NetHTTPSpecs.server_port) 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