diff options
author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2021-10-07 18:34:29 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2021-10-07 18:34:29 +0900 |
commit | ae5dffd66652752e3a7dfb3a6befa1df6cac7c74 (patch) | |
tree | 69fe2fb65a3f61fc963934c53e31c11452f43b72 /spec/ruby | |
parent | bd6e1a0f0883dba7b02f30cefe5ebec96d02cb90 (diff) |
Followed up bd6e1a0f0883dba7b02f30cefe5ebec96d02cb90
Diffstat (limited to 'spec/ruby')
-rw-r--r-- | spec/ruby/library/ipaddr/new_spec.rb | 41 |
1 files changed, 29 insertions, 12 deletions
diff --git a/spec/ruby/library/ipaddr/new_spec.rb b/spec/ruby/library/ipaddr/new_spec.rb index 3148d6e39c..053928c3cf 100644 --- a/spec/ruby/library/ipaddr/new_spec.rb +++ b/spec/ruby/library/ipaddr/new_spec.rb @@ -77,17 +77,34 @@ describe "IPAddr#new" do a.family.should == Socket::AF_INET6 end - it "raises on incorrect IPAddr strings" do - [ - ["fe80::1%fxp0"], - ["::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) - } + ruby_version_is ""..."3.1" do + it "raises on incorrect IPAddr strings" do + [ + ["fe80::1%fxp0"], + ["::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 + + 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 |