You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

calculator_steps.rb 378 B

2 years ago
123456789101112131415161718192021
  1. $LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../../lib")
  2. require 'calculator'
  3. Before do
  4. @calc = Calculator.new
  5. end
  6. After do
  7. end
  8. Given(/I have entered (\d+) into the calculator/) do |n|
  9. @calc.push n.to_i
  10. end
  11. When(/I press (\w+)/) do |op|
  12. @result = @calc.send op
  13. end
  14. Then(/the result should be (.*) on the screen/) do |result|
  15. expect(@result).to eq(result.to_f)
  16. end

No Description

Contributors (1)