Sha256: 32d449260ee072bdb9270321195b861a0e2237e0505a1d752bb9b1615373eb31

Contents?: true

Size: 973 Bytes

Versions: 1

Compression:

Stored size: 973 Bytes

Contents

require 'spec_helper'
module Alf
  module Lang
    module Parser
      describe Lispy do

        context 'when unbound' do
          let(:lispy){ Lispy.new }

          it 'allows parsing predicate expressions' do
            p = lispy.parse{ eq(:x, 1) & neq(:y, 2) }
            p.should be_a(Alf::Predicate)
          end

          it 'allows parsing relational expressions' do
            p = lispy.parse{ project(:suppliers, [:sid]) }
            p.should be_a(Algebra::Project)
          end
        end

        context 'when bound' do
          let(:lispy){ Lispy.new([], 12) }

          it 'allows parsing predicate expressions' do
            p = lispy.parse{ eq(:x, 1) & neq(:y, 2) }
            p.should be_a(Alf::Predicate)
          end

          it 'deeply binds parsed relational expressions' do
            p = lispy.parse{ project(:suppliers, [:sid]) }
            p.should be_a(Algebra::Project)
          end
        end

      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
alf-core-0.15.0 spec/unit/alf-lang/parser/lispy/test_parse.rb