Sha256: 48ea91468faa4fd0708b3d01f0cc142c065324a8622c6d0e2ec8b201356ab370
Contents?: true
Size: 809 Bytes
Versions: 5
Compression:
Stored size: 809 Bytes
Contents
require 'spec_helper' class Predicate describe Predicate, "qualify" do let(:p){ Predicate } subject{ predicate.qualify(qualifier) } let(:qualifier) { {:x => :t} } context 'on a full AST predicate' do let(:predicate){ p.in(:x, [2]) & p.eq(:y, 3) } it{ should eq(p.in(Factory.qualified_identifier(:t, :x), [2]) & p.eq(:y, 3)) } specify "it should tag expressions correctly" do subject.expr.should be_a(Sexpr) subject.expr.should be_a(Expr) subject.expr.should be_a(And) end end context 'on a predicate that contains natives' do let(:predicate){ p.in(:x, [2]) & p.native(lambda{}) } it 'raises an error' do lambda{ subject }.should raise_error(NotSupportedError) end end end end
Version data entries
5 entries across 5 versions & 1 rubygems