spec/expressive_spec.rb in expressive-0.0.1 vs spec/expressive_spec.rb in expressive-0.0.2
- old
+ new
@@ -19,15 +19,15 @@
@scope["hello"] = "World"
Expressive.run("hello", @scope).should eql "World"
end
describe "understands arithmetic" do
- it { Expressive.run("(+ 4 2)").should eql 6 }
- it { Expressive.run("(- 4 2)").should eql 2 }
- it { Expressive.run("(* 4 2)").should eql 8 }
- it { Expressive.run("(/ 4 2)").should eql 2 }
- it { Expressive.run("(sum 1 2 3)").should eql 6}
+ it { Expressive.run("(+ 4 2)").should eql 6.0 }
+ it { Expressive.run("(- 4 2)").should eql 2.0 }
+ it { Expressive.run("(* 4 2)").should eql 8.0 }
+ it { Expressive.run("(/ 4 2)").should eql 2.0 }
+ it { Expressive.run("(sum 1 2 3)").should eql 6.0}
end
describe "understands compound statements" do
it { Expressive.run("(= (+ 4 2) 6)").should eql true }
end
@@ -43,14 +43,14 @@
it "should set order_no to 1234" do
Expressive.run("(set order_no 1234)", @scope).should eql 1234
@scope["order_no"].should eql 1234
end
it "should reuse set properties" do
- Expressive.run("(set order_no 1234)(+ order_no 11)", @scope).should eql 1245
+ Expressive.run("(set order_no 1234)(+ order_no 11)", @scope).should eql 1245.0
end
it "should sum scoped arrays" do
@scope["sub_totals"] = [100, 200, 300]
- Expressive.run("(sum sub_totals)", @scope).should eql 600
+ Expressive.run("(sum sub_totals)", @scope).should eql 600.0
end
end
context "when setting complex properties" do
context "e.g. current_state" do