lib/active_support/testing/deprecation.rb in activesupport-5.0.7.2 vs lib/active_support/testing/deprecation.rb in activesupport-5.1.0.beta1

- old
+ new

@@ -1,15 +1,16 @@ -require 'active_support/deprecation' +require "active_support/deprecation" +require "active_support/core_ext/regexp" module ActiveSupport module Testing module Deprecation #:nodoc: def assert_deprecated(match = nil, deprecator = nil, &block) result, warnings = collect_deprecations(deprecator, &block) assert !warnings.empty?, "Expected a deprecation warning within the block but received none" if match match = Regexp.new(Regexp.escape(match)) unless match.is_a?(Regexp) - assert warnings.any? { |w| w =~ match }, "No deprecation warning matched #{match}: #{warnings.join(', ')}" + assert warnings.any? { |w| match.match?(w) }, "No deprecation warning matched #{match}: #{warnings.join(', ')}" end result end def assert_not_deprecated(deprecator = nil, &block)