spec/calculator_spec.rb in dentaku-0.2.1 vs spec/calculator_spec.rb in dentaku-0.2.2
- old
+ new
@@ -53,9 +53,14 @@
it 'should compare string literals with string variables' do
calculator.evaluate('fruit = "apple"', :fruit => 'apple').should be_true
calculator.evaluate('fruit = "apple"', :fruit => 'pear').should be_false
end
+ it 'should do case-sensitive comparison' do
+ calculator.evaluate('fruit = "Apple"', :fruit => 'apple').should be_false
+ calculator.evaluate('fruit = "Apple"', :fruit => 'Apple').should be_true
+ end
+
describe 'functions' do
it 'should include IF' do
calculator.evaluate('if (foo < 8, 10, 20)', :foo => 2).should eq(10)
calculator.evaluate('if (foo < 8, 10, 20)', :foo => 9).should eq(20)
end