Sha256: cf9c104079dc15692ef41eee71f05e94d5db1388a4527c58637d2a38dd10a410

Contents?: true

Size: 730 Bytes

Versions: 8

Compression:

Stored size: 730 Bytes

Contents

require 'spec_helper'
module Alf
  describe Reader::AlfFile do
    
    class TestEnv < Alf::Environment
      def dataset(name)
        [{:status => 10},{:status => 30}]
      end
    end
    
    let(:io){ StringIO.new(expr) }
    subject{ Reader::AlfFile.new(io, TestEnv.new).to_a }

    describe "on pure functional expressions" do
      let(:expr){ "(restrict :suppliers, lambda{status > 20})" }
      it{ should == [{:status => 30}]}
    end

    describe "on impure functional expressions" do
      let(:expr){
      <<-EOF
        xxx = (restrict :suppliers, lambda{status > 20})
        (extend xxx, :rev => lambda{ -status })
      EOF
      }
      it{ should == [{:status => 30, :rev => -30}]}
    end
      
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
alf-0.12.2 spec/unit/alf-core/reader/test_alf_file.rb
alf-0.12.1 spec/unit/alf-core/reader/test_alf_file.rb
alf-0.12.0 spec/unit/alf-core/reader/test_alf_file.rb
alf-0.11.1 spec/unit/alf-core/reader/test_alf_file.rb
alf-0.11.0 spec/unit/alf-core/reader/test_alf_file.rb
alf-0.10.1 spec/unit/reader/test_alf_file.rb
alf-0.10.0 spec/unit/reader/test_alf_file.rb
alf-0.9.3 spec/unit/reader/test_alf_file.rb