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

ruby-changes:63425

From: Benoit <ko1@a...>
Date: Sat, 24 Oct 2020 22:54:15 +0900 (JST)
Subject: [ruby-changes:63425] 342fbae83c (master): Update to ruby/mspec@b56e7a2

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

From 342fbae83c2e80d1b49656bc7c689cc7fe8980ce Mon Sep 17 00:00:00 2001
From: Benoit Daloze <eregontp@g...>
Date: Sat, 24 Oct 2020 15:52:35 +0200
Subject: Update to ruby/mspec@b56e7a2


diff --git a/spec/mspec/lib/mspec/runner/actions/leakchecker.rb b/spec/mspec/lib/mspec/runner/actions/leakchecker.rb
index 9efabc7..596b120 100644
--- a/spec/mspec/lib/mspec/runner/actions/leakchecker.rb
+++ b/spec/mspec/lib/mspec/runner/actions/leakchecker.rb
@@ -36,6 +36,7 @@ class LeakChecker https://github.com/ruby/ruby/blob/trunk/spec/mspec/lib/mspec/runner/actions/leakchecker.rb#L36
     @thread_info = find_threads
     @env_info = find_env
     @argv_info = find_argv
+    @globals_info = find_globals
     @encoding_info = find_encodings
   end
 
@@ -48,9 +49,10 @@ class LeakChecker https://github.com/ruby/ruby/blob/trunk/spec/mspec/lib/mspec/runner/actions/leakchecker.rb#L49
     check_process_leak
     check_env
     check_argv
+    check_globals
     check_encodings
     check_tracepoints
-    GC.start if !@leaks.empty?
+    GC.start unless @leaks.empty?
     @leaks.empty?
   end
 
@@ -244,6 +246,19 @@ class LeakChecker https://github.com/ruby/ruby/blob/trunk/spec/mspec/lib/mspec/runner/actions/leakchecker.rb#L246
     end
   end
 
+  def find_globals
+    { verbose: $VERBOSE, debug: $DEBUG }
+  end
+
+  def check_globals
+    old_globals = @globals_info
+    new_globals = find_globals
+    if new_globals != old_globals
+      leak "Globals changed: #{old_globals.inspect} to #{new_globals.inspect}"
+      @globals_info = new_globals
+    end
+  end
+
   def find_encodings
     [Encoding.default_internal, Encoding.default_external]
   end
diff --git a/spec/mspec/lib/mspec/utils/warnings.rb b/spec/mspec/lib/mspec/utils/warnings.rb
index 1cd9153..288dbe7 100644
--- a/spec/mspec/lib/mspec/utils/warnings.rb
+++ b/spec/mspec/lib/mspec/utils/warnings.rb
@@ -45,7 +45,6 @@ if Object.const_defined?(:Warning) and Warning.respond_to?(:warn) https://github.com/ruby/ruby/blob/trunk/spec/mspec/lib/mspec/utils/warnings.rb#L45
     when /\/(argf|io|stringio)\/.+(ARGF|IO)#(lines|chars|bytes|codepoints) is deprecated/
     when /Thread\.exclusive is deprecated.+\n.+thread\/exclusive_spec\.rb/
     when /hash\/shared\/index\.rb:\d+: warning: Hash#index is deprecated; use Hash#key/
-    when /env\/shared\/key\.rb:\d+: warning: ENV\.index is deprecated; use ENV\.key/
     when /exponent(_spec)?\.rb:\d+: warning: in a\*\*b, b may be too big/
     when /enumerator\/(new_spec|initialize_spec)\.rb:\d+: warning: Enumerator\.new without a block is deprecated/
     when /Pattern matching is experimental, and the behavior may change in future versions of Ruby!/
-- 
cgit v0.10.2


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

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