Sha256: 7068e015167a23a300e59121544f67de8df700fabc9f28a8429c483a84484e58
Contents?: true
Size: 752 Bytes
Versions: 9
Compression:
Stored size: 752 Bytes
Contents
require 'spec_helper' module Alf module Engine describe Compact::Uniq do it 'should work on an empty operand' do Compact::Uniq.new([]).to_a.should eq([]) end it 'should work when no duplicate is present' do rel = [ {:name => "Jones"}, {:name => "Smith"} ] Compact::Uniq.new(rel).to_a.should eq(rel) end it 'should work when duplicates are present' do rel = [ {:name => "Jones"}, {:name => "Smith"}, {:name => "Jones"}, ] exp = [ {:name => "Jones"}, {:name => "Smith"} ] Compact::Uniq.new(rel).to_a.should eq(exp) end end end # module Engine end # module Alf
Version data entries
9 entries across 9 versions & 2 rubygems