Sha256: 5437d1dc576f7727dc2364148d8900d749b8b427bd03943c68b3171396fe34b9

Contents?: true

Size: 524 Bytes

Versions: 5

Compression:

Stored size: 524 Bytes

Contents

require 'spec_helper'
module Alf
  module Engine
    describe Filter do

      it 'should work on an empty operand' do
        Filter.new([], TuplePredicate[true]).to_a.should eq([])
      end

      it 'should filter according to the predicate' do
        rel = [
          {:name => "Jones"},
          {:name => "Smith"}
        ]
        exp = [
          {:name => "Jones"},
        ]
        Filter.new(rel, TuplePredicate["name =~ /^J/"]).to_a.should eq(exp)
      end

    end
  end # module Engine
end # module Alf

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
alf-0.12.2 spec/unit/alf-engine/test_filter.rb
alf-0.12.1 spec/unit/alf-engine/test_filter.rb
alf-0.12.0 spec/unit/alf-engine/test_filter.rb
alf-0.11.1 spec/unit/alf-engine/test_filter.rb
alf-0.11.0 spec/unit/alf-engine/test_filter.rb