diff options
Diffstat (limited to 'spec/support/matchers.rb')
-rw-r--r-- | spec/support/matchers.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/spec/support/matchers.rb b/spec/support/matchers.rb index 9248360639..4fbf44a4e0 100644 --- a/spec/support/matchers.rb +++ b/spec/support/matchers.rb @@ -78,7 +78,12 @@ module Spec RSpec::Matchers.define :have_major_deprecation do |expected| diffable match do |actual| - actual.split(MAJOR_DEPRECATION).any? do |d| + deprecations = actual.split(MAJOR_DEPRECATION) + + return !expected.nil? if deprecations.size <= 1 + return true if expected.nil? + + deprecations.any? do |d| !d.empty? && values_match?(expected, d.strip) end end |