From d54322bc8d82a23a4df0c72a41857b6c70fa1581 Mon Sep 17 00:00:00 2001 From: Brent Haas Date: Fri, 11 May 2012 11:24:47 -0700 Subject: [PATCH] Fixed RPN logic bug in minus and divide tests. 2, 3, 4, -, - == (4-3)-2 --- 13_rpn_calculator/rpn_calculator_spec.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/13_rpn_calculator/rpn_calculator_spec.rb b/13_rpn_calculator/rpn_calculator_spec.rb index f936f8650..ef48b63e5 100644 --- a/13_rpn_calculator/rpn_calculator_spec.rb +++ b/13_rpn_calculator/rpn_calculator_spec.rb @@ -29,8 +29,8 @@ it "adds and subtracts" do calculator.push(2) - calculator.push(3) calculator.push(4) + calculator.push(3) calculator.minus calculator.value.should == -1 calculator.plus @@ -39,12 +39,12 @@ it "multiplies and divides" do calculator.push(2) - calculator.push(3) calculator.push(4) + calculator.push(3) calculator.divide calculator.value.should == 0.75 calculator.times - calculator.value.should == 1.5 + calculator.value.should == 0.375 end it "resolves operator precedence unambiguously" do