Skip to content

Cleanup of afamily/pfamily specs for Addrinfo#initialize #1274

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions library/socket/addrinfo/initialize_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
@addrinfo.ip_port.should == 25
end

it "returns the Socket::UNSPEC pfamily" do
it "returns the UNSPEC pfamily" do
@addrinfo.pfamily.should == Socket::PF_UNSPEC
end

Expand Down Expand Up @@ -53,7 +53,7 @@
@addrinfo.ip_port.should == 25
end

it "returns the Socket::UNSPEC pfamily" do
it "returns the INET6 pfamily" do
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but in most cases a test checks that a getter returns a value passed into a constructor and nothing more. So a test title may be more generic, e.g. returns pfamily. And it seems it doesn't matter what a specific value is used.

@addrinfo.pfamily.should == Socket::PF_INET6
end

Expand Down Expand Up @@ -83,7 +83,7 @@
@addrinfo.ip_port.should == 25
end

it "returns the Socket::UNSPEC pfamily" do
it "returns the INET6 pfamily" do
@addrinfo.pfamily.should == Socket::PF_INET6
end

Expand Down Expand Up @@ -113,7 +113,7 @@
@addrinfo.ip_port.should == 25
end

it "returns the Socket::UNSPEC pfamily" do
it "returns the INET6 pfamily" do
@addrinfo.pfamily.should == Socket::PF_INET6
end

Expand Down Expand Up @@ -147,11 +147,11 @@
@addrinfo.ip_port.should == 46102
end

it "returns the Socket::PF_INET pfamily" do
it "returns the INET pfamily" do
@addrinfo.pfamily.should == Socket::PF_INET
end

it "returns the INET6 afamily" do
it "returns the INET afamily" do
@addrinfo.afamily.should == Socket::AF_INET
end

Expand Down Expand Up @@ -217,11 +217,11 @@
@addrinfo.ip_port.should == 46102
end

it "returns the Socket::UNSPEC pfamily" do
it "returns the INET pfamily" do
@addrinfo.pfamily.should == Socket::PF_INET
end

it "returns the INET6 afamily" do
it "returns the INET afamily" do
@addrinfo.afamily.should == Socket::AF_INET
end

Expand All @@ -247,11 +247,11 @@
@addrinfo.ip_port.should == 46102
end

it "returns the Socket::UNSPEC pfamily" do
it "returns the INET pfamily" do
@addrinfo.pfamily.should == Socket::PF_INET
end

it "returns the INET6 afamily" do
it "returns the INET afamily" do
@addrinfo.afamily.should == Socket::AF_INET
end

Expand Down Expand Up @@ -311,11 +311,11 @@
@addrinfo.ip_port.should == 46102
end

it "returns the Socket::UNSPEC pfamily" do
it "returns the INET pfamily" do
@addrinfo.pfamily.should == Socket::PF_INET
end

it "returns the INET6 afamily" do
it "returns the INET afamily" do
@addrinfo.afamily.should == Socket::AF_INET
end

Expand Down Expand Up @@ -514,13 +514,13 @@
@sockaddr = Socket.sockaddr_in(80, '127.0.0.1')
end

it 'returns an Addrinfo with :PF_INET family' do
it 'returns an Addrinfo with :PF_INET family' do
addr = Addrinfo.new(@sockaddr, :PF_INET)

addr.pfamily.should == Socket::PF_INET
end

it 'returns an Addrinfo with :INET family' do
it 'returns an Addrinfo with :INET family' do
addr = Addrinfo.new(@sockaddr, :INET)

addr.pfamily.should == Socket::PF_INET
Expand All @@ -544,13 +544,13 @@
@sockaddr = Socket.sockaddr_in(80, '127.0.0.1')
end

it 'returns an Addrinfo with "PF_INET" family' do
it 'returns an Addrinfo with "PF_INET" family' do
addr = Addrinfo.new(@sockaddr, 'PF_INET')

addr.pfamily.should == Socket::PF_INET
end

it 'returns an Addrinfo with "INET" family' do
it 'returns an Addrinfo with "INET" family' do
addr = Addrinfo.new(@sockaddr, 'INET')

addr.pfamily.should == Socket::PF_INET
Expand Down