Sha256: 09a5c8d4849e0dcb518a130e014b717840f396201db83e982c888d8e94d80521

Contents?: true

Size: 747 Bytes

Versions: 9

Compression:

Stored size: 747 Bytes

Contents

require 'spec_helper'
module Alf
  module Engine
    describe Ungroup do

      let(:input){[
        {:city => "London", :suppliers => [
                              {:name => "Smith"},
                              {:name => "Blake"}
                            ]},
        {:city => "Paris", :suppliers => [
                              {:name => "Jones"}
                            ]},
      ]}

      let(:expected){[
        {:name => "Smith", :city => "London"},
        {:name => "Blake", :city => "London"},
        {:name => "Jones", :city => "Paris"},
      ]}

      it 'should ungroup specified attribute' do
        Ungroup.new(input, :suppliers).to_a.should eq(expected)
      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_ungroup.rb
alf-core-0.14.0 spec/unit/alf-engine/test_ungroup.rb
alf-core-0.13.1 spec/unit/alf-engine/test_ungroup.rb
alf-core-0.13.0 spec/unit/alf-engine/test_ungroup.rb
alf-0.12.2 spec/unit/alf-engine/test_ungroup.rb
alf-0.12.1 spec/unit/alf-engine/test_ungroup.rb
alf-0.12.0 spec/unit/alf-engine/test_ungroup.rb
alf-0.11.1 spec/unit/alf-engine/test_ungroup.rb
alf-0.11.0 spec/unit/alf-engine/test_ungroup.rb