Sha256: 4bb9255b2a41bd151e69a1ff9d03069040f5fa56f7c1b9fb1ffe2419419f87dc

Contents?: true

Size: 771 Bytes

Versions: 5

Compression:

Stored size: 771 Bytes

Contents

require 'spec_helper'
module Alf
  module Operator::Relational
    describe Ungroup do

      let(:operator_class){ Ungroup }
      it_should_behave_like("An operator class")

      let(:input) {[
        {:a => "via_method", :as => [{:time => 1, :b => "b"}, {:time => 2, :b => "b"}]},
        {:a => "via_reader", :as => [{:time => 3, :b => "b"}]},
      ]}

      let(:expected) {[
        {:a => "via_method", :time => 1, :b => "b"},
        {:a => "via_method", :time => 2, :b => "b"},
        {:a => "via_reader", :time => 3, :b => "b"},
      ]}

      subject{ operator.to_a.sort{|k1,k2| k1[:time] <=> k2[:time]} } 

      context "with Lispy" do
        let(:operator) { Lispy.ungroup(input, :as) } 
        it { should == expected }
      end

    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
alf-0.12.2 spec/unit/alf-core/operator/relational/test_ungroup.rb
alf-0.12.1 spec/unit/alf-core/operator/relational/test_ungroup.rb
alf-0.12.0 spec/unit/alf-core/operator/relational/test_ungroup.rb
alf-0.11.1 spec/unit/alf-core/operator/relational/test_ungroup.rb
alf-0.11.0 spec/unit/alf-core/operator/relational/test_ungroup.rb