Sha256: 8dcdaf526d3168f508ac4fa08b7f676b3c4e6d66e6f737449705d9f738efdcfa

Contents?: true

Size: 715 Bytes

Versions: 4

Compression:

Stored size: 715 Bytes

Contents

require 'spec_helper'
module Alf
  describe Lispy do
    include Lispy

    let(:input){[
      {:tested => 1,  :other => "b"},
      {:tested => 30, :other => "a"},
    ]}

    let(:expected){[
      {:tested => 30, :other => "a", :upcase => "A"},
    ]}

    it "should allow chaining operators 'ala' LISP" do
      operator = (extend \
                   (restrict input, lambda{ tested > 10 }),
                   :upcase => lambda{ other.upcase })
      operator.to_a.should == expected
    end

    it "should allow building aggregators" do
      sum{ qty }.should be_a(Aggregator::Sum)
    end

    it "should have stddev aggregator" do
      stddev{ qty }.should be_a(Aggregator::Stddev)
    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
alf-0.12.2 spec/integration/test_lispy.rb
alf-0.12.1 spec/integration/test_lispy.rb
alf-0.12.0 spec/integration/test_lispy.rb
alf-0.11.1 spec/integration/test_lispy.rb