spec/expressive_spec.rb in expressive-0.0.34 vs spec/expressive_spec.rb in expressive-0.0.35
- old
+ new
@@ -4,11 +4,11 @@
before(:each) do
@scope = Expressive::TopLevel.new
end
describe "all_symbols" do
- it { Expressive.all_symbols.should =~ %w(+ - * / = set sum $sub get put post >= > < <= and or if date datetime lookup round $round $days_ago $hours_ago $minutes_ago $append $id $head $lookup $reverse $tail $hash $concat $split $sms $hval $index $random $join $not) }
+ it { Expressive.all_symbols.should =~ %w(+ - * / = set sum $sub get put post >= > < <= and or if date datetime lookup round $round $days_ago $hours_ago $minutes_ago $append $id $head $lookup $reverse $tail $hash $concat $split $sms $hval $index $random $join $not $include) }
end
describe "understands booleans" do
it { Expressive.run("true").should eql true }
it { Expressive.run("false").should eql false }
@@ -82,9 +82,13 @@
it { Expressive.run("(<= 4 4)").should eql true }
end
describe "understands list operations" do
it { Expressive.run("($head (1 2 3))").should eql 1 }
+ it { Expressive.run("($include 3 (1 2 3))").should eql true }
+ it { Expressive.run("($include 4 (1 2 3))").should eql false }
+ it { Expressive.run("($include ADAM001 (ADAM001 AIBO001 AMBR001 BARC002 BARC003))").should eql true}
+ it { Expressive.run("($include BDAM001 (ADAM001 AIBO001 AMBR001 BARC002 BARC003))").should eql true}
it { Expressive.run("($tail (1 2 3))").should eql [2, 3] }
it { Expressive.run("($reverse (1 2 3))").should eql [3 ,2 ,1] }
end
describe "understands compound statements" do