Sha256: 3f61ce046feb9ab7efc5b8cdd586930ef1bbe058d3a1724a59a73db885b0b121

Contents?: true

Size: 613 Bytes

Versions: 15

Compression:

Stored size: 613 Bytes

Contents

require 'spec_helper'
class Predicate
  describe And, "&" do

    let(:left){
      Factory.eq(:x, 2) & Factory.eq(:y, 3)
    }

    subject{ left & right }

    context 'with another predicate' do
      let(:right) {
        Factory.eq(:z, 4)
      }

      it 'collects it' do
        expect(subject).to be_a(And)
        expect(subject.size).to eql(4)
      end
    end

    context 'with another and' do
      let(:right) {
        Factory.eq(:w, 5) & Factory.eq(:z, 4)
      }

      it 'collects it' do
        expect(subject).to be_a(And)
        expect(subject.size).to eql(5)
      end
    end

  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
predicate-2.8.0 spec/nodes/and/test_and.rb
predicate-2.7.1 spec/nodes/and/test_and.rb
predicate-2.7.0 spec/nodes/and/test_and.rb
predicate-2.6.0 spec/nodes/and/test_and.rb
predicate-2.5.0 spec/nodes/and/test_and.rb
predicate-2.4.0 spec/nodes/and/test_and.rb
predicate-2.3.3 spec/nodes/and/test_and.rb
predicate-2.3.2 spec/nodes/and/test_and.rb
predicate-2.3.1 spec/nodes/and/test_and.rb
predicate-2.3.0 spec/nodes/and/test_and.rb
predicate-2.2.1 spec/nodes/and/test_and.rb
predicate-2.2.0 spec/nodes/and/test_and.rb
predicate-2.1.0 spec/nodes/and/test_and.rb
predicate-2.0.1 spec/nodes/and/test_and.rb
predicate-2.0.0 spec/nodes/and/test_and.rb