Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2018-06-22 18:46:33 +0300
committerLin Jen-Shin <godfat@godfat.org>2018-06-22 18:46:33 +0300
commit3c242dda8c463f53cb11b1a3609af3b5f50eae9d (patch)
tree505d132d68a6f4571c4109cf18547d6bdc22eaf9 /spec/support/matchers
parent254e589de918a0bce3fab78d4c11f041c01f2d69 (diff)
Bring changes from EE
Diffstat (limited to 'spec/support/matchers')
-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)