Sha256: 78527bc7515ef68b6f732b2126d2c0843aba7f41aef7381b75c53e92f2a343d0

Contents?: true

Size: 746 Bytes

Versions: 9

Compression:

Stored size: 746 Bytes

Contents

require 'spec_helper'
module Alf
  module Engine
    describe Compact do

      it 'should work on an empty operand' do
        Compact.new([]).to_a.should eq([])
      end

      it 'should work when no duplicate is present' do
        rel = [
          {:name => "Jones"},
          {:name => "Smith"}
        ]
        Compact.new(rel).to_set.should eq(rel.to_set)
      end

      it 'should work when duplicates are present' do
        rel = [
          {:name => "Jones"},
          {:name => "Smith"},
          {:name => "Jones"},
        ]
        exp = [
          {:name => "Jones"},
          {:name => "Smith"}
        ]
        Compact.new(rel).to_set.should eq(exp.to_set)
      end

    end
  end # module Engine
end # module Alf

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
alf-core-0.15.0 spec/unit/alf-engine/test_compact.rb
alf-core-0.14.0 spec/unit/alf-engine/test_compact.rb
alf-core-0.13.1 spec/unit/alf-engine/test_compact.rb
alf-core-0.13.0 spec/unit/alf-engine/test_compact.rb
alf-0.12.2 spec/unit/alf-engine/test_compact.rb
alf-0.12.1 spec/unit/alf-engine/test_compact.rb
alf-0.12.0 spec/unit/alf-engine/test_compact.rb
alf-0.11.1 spec/unit/alf-engine/test_compact.rb
alf-0.11.0 spec/unit/alf-engine/test_compact.rb