Followed up bd6e1a0f0883dba7b02f30cefe5ebec96d02cb90

This commit is contained in:
Hiroshi SHIBATA 2021-10-07 18:34:29 +09:00
parent bd6e1a0f08
commit ae5dffd666
No known key found for this signature in database
GPG Key ID: F9CF13417264FAC2

View File

@ -77,6 +77,7 @@ describe "IPAddr#new" do
a.family.should == Socket::AF_INET6
end
ruby_version_is ""..."3.1" do
it "raises on incorrect IPAddr strings" do
[
["fe80::1%fxp0"],
@ -90,4 +91,20 @@ describe "IPAddr#new" do
}.should raise_error(ArgumentError)
}
end
end
ruby_version_is "3.1" do
it "raises on incorrect IPAddr strings" do
[
["::1/255.255.255.0"],
[IPAddr.new("::1").to_i],
["::ffff:192.168.1.2/120", Socket::AF_INET],
["[192.168.1.2]/120"],
].each { |args|
->{
IPAddr.new(*args)
}.should raise_error(ArgumentError)
}
end
end
end