summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2018-06-22 16:35:19 +0000
committerRobert Speicher <robert@gitlab.com>2018-06-22 16:35:19 +0000
commit643466f6b912c36130e3c287ce771cefd3bc4caf (patch)
treecd50a0c01b323e2fb5d74d1c127889ce5d78cfe9
parent70bc8665637e7d306f2612ab1965eb337cea27ac (diff)
parent3c242dda8c463f53cb11b1a3609af3b5f50eae9d (diff)
downloadgitlab-ce-643466f6b912c36130e3c287ce771cefd3bc4caf.tar.gz
Merge branch 'unify-match_ids.rb' into 'master'
Unify spec/support/matchers/match_ids.rb See merge request gitlab-org/gitlab-ce!20108
-rw-r--r--spec/support/matchers/match_ids.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/support/matchers/match_ids.rb b/spec/support/matchers/match_ids.rb
index d8424405b96..1cb6b74acac 100644
--- a/spec/support/matchers/match_ids.rb
+++ b/spec/support/matchers/match_ids.rb
@@ -10,6 +10,13 @@ RSpec::Matchers.define :match_ids do |*expected|
'matches elements by ids'
end
+ failure_message do
+ actual_ids = map_ids(actual)
+ expected_ids = map_ids(expected)
+
+ "expected IDs #{actual_ids} in:\n\n #{actual.inspect}\n\nto match IDs #{expected_ids} in:\n\n #{expected.inspect}"
+ end
+
def map_ids(elements)
elements = elements.flatten if elements.respond_to?(:flatten)