Skip to content
Snippets Groups Projects
Commit 643466f6 authored by Robert Speicher's avatar Robert Speicher
Browse files

Merge branch 'unify-match_ids.rb' into 'master'

Unify spec/support/matchers/match_ids.rb

See merge request gitlab-org/gitlab-ce!20108
parents 70bc8665 3c242dda
No related branches found
No related tags found
1 merge request!10495Merge Requests - Assignee
Loading
Loading
@@ -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)
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment