From 8645a5d741cf9e075bd6b1e16c223e255a8e8cc0 Mon Sep 17 00:00:00 2001 From: Samuel Giddins Date: Wed, 14 Jun 2017 09:55:55 -0500 Subject: Fix matching against no major deprecations --- spec/support/matchers.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 -- cgit v1.2.1