spec/calculator_spec.rb in dentaku-2.0.2 vs spec/calculator_spec.rb in dentaku-2.0.3
- old
+ new
@@ -25,10 +25,12 @@
expect(calculator.evaluate('-num + 3', num: 2)).to eq(1)
expect(calculator.evaluate('10 ^ 2')).to eq(100)
expect(calculator.evaluate('0 * 10 ^ -5')).to eq(0)
expect(calculator.evaluate('3 + 0 * -3')).to eq(3)
expect(calculator.evaluate('3 + 0 / -3')).to eq(3)
+ expect(calculator.evaluate('15 % 8')).to eq(7)
+ expect(calculator.evaluate('(((695759/735000)^(1/(1981-1991)))-1)*1000').round(4)).to eq(5.5018)
end
describe 'memory' do
it { expect(calculator).to be_empty }
it { expect(with_memory).not_to be_empty }
@@ -79,10 +81,10 @@
end
it "lets you know about a cycle if one occurs" do
expect do
calculator.solve!(health: "happiness", happiness: "health")
- end.to raise_error (TSort::Cyclic)
+ end.to raise_error(TSort::Cyclic)
end
it 'is case-insensitive' do
result = with_memory.solve!(total_fruit: "Apples + pears", pears: 10)
expect(result[:total_fruit]).to eq 13