diff --git a/lib/mspec/utils/warnings.rb b/lib/mspec/utils/warnings.rb index e1964837..1cd9153a 100644 --- a/lib/mspec/utils/warnings.rb +++ b/lib/mspec/utils/warnings.rb @@ -1,5 +1,11 @@ require 'mspec/guards/version' +# 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