diff options
author | Samuel Giddins <segiddins@segiddins.me> | 2017-06-14 09:55:55 -0500 |
---|---|---|
committer | Samuel Giddins <segiddins@segiddins.me> | 2017-06-14 16:09:39 -0500 |
commit | 8645a5d741cf9e075bd6b1e16c223e255a8e8cc0 (patch) | |
tree | 07d26a3fbdf6f2ee5aa96593bf25759642ced0d0 | |
parent | ddcca6254cc4e63cbb25b78f8ec93462fa56249c (diff) | |
download | bundler-8645a5d741cf9e075bd6b1e16c223e255a8e8cc0.tar.gz |
Fix matching against no major deprecations
-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 |