spec/evaluator_spec.rb in dentaku-0.2.9 vs spec/evaluator_spec.rb in dentaku-0.2.10
- old
+ new
@@ -51,9 +51,13 @@
end
it 'should respect explicit grouping' do
evaluator.evaluate(token_stream(:open, 1, :add, 1, :close, :multiply, 5)).should eq(10)
end
+
+ it 'should return floating point from division when there is a remainder' do
+ evaluator.evaluate(token_stream(5, :divide, 4)).should eq(1.25)
+ end
end
describe 'functions' do
it 'should evaluate function' do
evaluator.evaluate(token_stream(:round, :open, 5, :divide, 3.0, :close)).should eq 2