blob: e19b30fca9becbd4ff090360d4cb124a2f663b15 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
require_relative '../../../spec_helper'
require 'net/http'
describe "Net::HTTP.newobj" do
before :each do
@net = Net::HTTP.newobj("localhost")
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 == "localhost"
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("localhost", 3333)
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 == "localhost"
end
it "sets the new Net::HTTP instance's port to the passed port" do
@net.port.should eql(3333)
end
it "does not start the new Net::HTTP instance" do
@net.started?.should be_false
end
end
end
|