Skip to content

Commit

Permalink
Always enable deprecation warnings when running MSpec
Browse files Browse the repository at this point in the history
  • Loading branch information
eregon committed Sep 30, 2020
1 parent f7b192c commit e154fa1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/mspec/utils/warnings.rb
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit e154fa1

Please sign in to comment.