[前][次][番号順一覧][スレッド一覧]

ruby-changes:68292

From: Hiroshi <ko1@a...>
Date: Thu, 7 Oct 2021 18:35:50 +0900 (JST)
Subject: [ruby-changes:68292] ae5dffd666 (master): Followed up bd6e1a0f0883dba7b02f30cefe5ebec96d02cb90

https://git.ruby-lang.org/ruby.git/commit/?id=ae5dffd666

From ae5dffd66652752e3a7dfb3a6befa1df6cac7c74 Mon Sep 17 00:00:00 2001
From: Hiroshi SHIBATA <hsbt@r...>
Date: Thu, 7 Oct 2021 18:34:29 +0900
Subject: Followed up bd6e1a0f0883dba7b02f30cefe5ebec96d02cb90

---
 spec/ruby/library/ipaddr/new_spec.rb | 41 +++++++++++++++++++++++++-----------
 1 file 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 https://github.com/ruby/ruby/blob/trunk/spec/ruby/library/ipaddr/new_spec.rb#L77
     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
-- 
cgit v1.2.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]