Commit 78dfbca6 authored by Shinya Maeda's avatar Shinya Maeda

Use nice message

parent dd4a8df4
......@@ -3,7 +3,10 @@
shared_examples 'Unique enum values' do
described_class.defined_enums.each do |name, hash|
it "has unique values in #{name}" do
expect(hash.values).to contain_exactly(*hash.values.uniq)
duplicated = hash.group_by(&:last).select { |key, value| value.size > 1 }
expect(duplicated).to be_empty,
"Duplicated values detected: #{duplicated.values.map(&Hash.method(:[]))}"
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment