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

ruby-changes:58549

From: Benoit <ko1@a...>
Date: Sun, 3 Nov 2019 19:26:21 +0900 (JST)
Subject: [ruby-changes:58549] 782d1b8fb0 (master): Fix warnings in Regexp#{match, match?} specs

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

From 782d1b8fb0a039cedef9ad9c94f432dad51901e6 Mon Sep 17 00:00:00 2001
From: Benoit Daloze <eregontp@g...>
Date: Sun, 3 Nov 2019 11:25:42 +0100
Subject: Fix warnings in Regexp#{match,match?} specs


diff --git a/spec/ruby/core/regexp/match_spec.rb b/spec/ruby/core/regexp/match_spec.rb
index e2075d1..0ce8347 100644
--- a/spec/ruby/core/regexp/match_spec.rb
+++ b/spec/ruby/core/regexp/match_spec.rb
@@ -89,12 +89,14 @@ describe "Regexp#match" do https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/regexp/match_spec.rb#L89
 
   ruby_version_is ""..."3.0" do
     it "resets $~ if passed nil" do
-      # set $~
-      /./.match("a")
-      $~.should be_kind_of(MatchData)
+      suppress_warning do
+        # set $~
+        /./.match("a")
+        $~.should be_kind_of(MatchData)
 
-      /1/.match(nil)
-      $~.should be_nil
+        /1/.match(nil)
+        $~.should be_nil
+      end
     end
   end
 
@@ -145,7 +147,9 @@ describe "Regexp#match?" do https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/regexp/match_spec.rb#L147
 
   ruby_version_is ""..."3.0" do
     it "returns false when given nil" do
-      /./.match?(nil).should be_false
+      suppress_warning do
+        /./.match?(nil).should be_false
+      end
     end
   end
 
-- 
cgit v0.10.2


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

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