Skip to content

Commit

Permalink
Better detection for whether Warning.warn is supported
Browse files Browse the repository at this point in the history
  • Loading branch information
eregon committed Sep 30, 2020
1 parent 4120a62 commit f7b192c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/mspec/utils/warnings.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'mspec/guards/version'

if RUBY_ENGINE == "ruby"
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
Expand Down

0 comments on commit f7b192c

Please sign in to comment.