Sha256: 86bb037a63be0fb0817aaa2270f31061313f10905330930b3300c68b278c93d9

Contents?: true

Size: 838 Bytes

Versions: 9

Compression:

Stored size: 838 Bytes

Contents

require 'spec_helper'
module Alf
  module Engine
    describe Concat do

      it 'should work on no operand at all' do
        Concat.new([]).to_a.should eq([])
      end

      it 'should work with only one operand' do
        rel = [
          {:name => "Jones"},
          {:name => "Smith"}
        ]
        Concat.new([rel]).to_a.should eq(rel)
      end

      it 'should work with multiple operands' do
        rel = [
          {:name => "Jones"},
          {:name => "Smith"}
        ]
        rel2 = [
          {:name => "Jones"},
          {:name => "Clark"}
        ]
        exp = [
          {:name => "Jones"},
          {:name => "Smith"},
          {:name => "Jones"},
          {:name => "Clark"}
        ]
        Concat.new([rel, rel2]).to_a.should eq(exp)
      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_concat.rb
alf-core-0.14.0 spec/unit/alf-engine/test_concat.rb
alf-core-0.13.1 spec/unit/alf-engine/test_concat.rb
alf-core-0.13.0 spec/unit/alf-engine/test_concat.rb
alf-0.12.2 spec/unit/alf-engine/test_concat.rb
alf-0.12.1 spec/unit/alf-engine/test_concat.rb
alf-0.12.0 spec/unit/alf-engine/test_concat.rb
alf-0.11.1 spec/unit/alf-engine/test_concat.rb
alf-0.11.0 spec/unit/alf-engine/test_concat.rb