diff options
author | Benoit Daloze <eregontp@gmail.com> | 2020-09-30 13:43:17 +0200 |
---|---|---|
committer | Benoit Daloze <eregontp@gmail.com> | 2020-09-30 13:43:17 +0200 |
commit | bbecf1eb6b5651a073eb20c9b137cfe08d2739aa (patch) | |
tree | 803f14911d02309f846f251b3b0a3e4fb058d22d /spec/mspec | |
parent | 9501b34dfc118763e93ba6381ec12f2a71a31e01 (diff) | |
download | ruby-bbecf1eb6b5651a073eb20c9b137cfe08d2739aa.tar.gz |
Update to ruby/mspec@e154fa1
Diffstat (limited to 'spec/mspec')
-rw-r--r-- | spec/mspec/lib/mspec/utils/warnings.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/spec/mspec/lib/mspec/utils/warnings.rb b/spec/mspec/lib/mspec/utils/warnings.rb index 01fca00b8d..1cd9153a37 100644 --- a/spec/mspec/lib/mspec/utils/warnings.rb +++ b/spec/mspec/lib/mspec/utils/warnings.rb @@ -1,6 +1,12 @@ 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 |