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

ruby-changes:63217

From: Benoit <ko1@a...>
Date: Wed, 30 Sep 2020 20:43:41 +0900 (JST)
Subject: [ruby-changes:63217] bbecf1eb6b (master): Update to ruby/mspec@e154fa1

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

From bbecf1eb6b5651a073eb20c9b137cfe08d2739aa Mon Sep 17 00:00:00 2001
From: Benoit Daloze <eregontp@g...>
Date: Wed, 30 Sep 2020 13:43:17 +0200
Subject: Update to ruby/mspec@e154fa1


diff --git a/spec/mspec/lib/mspec/utils/warnings.rb b/spec/mspec/lib/mspec/utils/warnings.rb
index 01fca00..1cd9153 100644
--- a/spec/mspec/lib/mspec/utils/warnings.rb
+++ b/spec/mspec/lib/mspec/utils/warnings.rb
@@ -1,6 +1,12 @@ https://github.com/ruby/ruby/blob/trunk/spec/mspec/lib/mspec/utils/warnings.rb#L1
 require 'mspec/guards/version'
 
-if RUBY_ENGINE == "ruby"
+# Always enable deprecation warnings when running MSpec, as ruby/spec tests for them,
+# and like in most test frameworks, all warnings should be enabled by default (same as -w).
+if Object.const_defined?(:Warning) and Warning.respond_to?(:[]=)
+  Warning[:deprecated] = true
+end
+
+if Object.const_defined?(:Warning) and Warning.respond_to?(:warn)
   def Warning.warn(message)
     # Suppress any warning inside the method to prevent recursion
     verbose = $VERBOSE
-- 
cgit v0.10.2


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

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