Skip to content

Commit

Permalink
Add tests for multiple IP addresses
Browse files Browse the repository at this point in the history
  • Loading branch information
zeroSteiner committed Feb 9, 2024
1 parent 97c2871 commit f2b92c0
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions spec/rex/socket_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,13 @@
end
end

context 'with multiple IPv4 addresses' do
let(:try) { "127.0.0.1\n127.0.0.1" }
it 'should return false' do
expect(addr).to eq false
end
end

context 'with an IPv6 address' do
let(:try) { '::1' }
it 'should return false' do
Expand Down Expand Up @@ -283,6 +290,13 @@
end
end

context 'with multiple IPv6 addresses' do
let(:try) { "::1\n::1" }
it 'should return false' do
expect(addr).to eq false
end
end

context 'with a hostname' do
let(:try) { "localhost" }
it "should return false" do
Expand Down

0 comments on commit f2b92c0

Please sign in to comment.