Sha256: 84b7a6a180e386d3d01be6d6c1d7e936f12f90d466db2272a509680921fbc977

Contents?: true

Size: 525 Bytes

Versions: 45

Compression:

Stored size: 525 Bytes

Contents

# encoding: utf-8
require 'spec/expectations'
$:.unshift(File.dirname(__FILE__) + '/../../lib') # This line is not needed in your own project
require 'cucumber/formatters/unicode'
require 'calculator'

Before do
  @calc = Calculator.new
end

After do
end

Given /我已经在计算器里输入(\d+)/ do |n|
  @calc.push n.to_i
end

When /我按(.*)按钮/ do |op|
  if op == '相加'
    @result = @calc.send "add"
  end
end

Then /我应该在屏幕上看到的结果是(.*)/ do |result|
  @result.should == result.to_f
end

Version data entries

45 entries across 45 versions & 4 rubygems

Version Path
aslakhellesoy-cucumber-0.1.100.1 examples/i18n/zh-CN/features/step_definitons/calculator_steps.rb
aslakhellesoy-cucumber-0.1.100.2 examples/i18n/zh-CN/features/step_definitons/calculator_steps.rb
aslakhellesoy-cucumber-0.1.100.3 examples/i18n/zh-CN/features/step_definitons/calculator_steps.rb
aslakhellesoy-cucumber-0.1.100.4 examples/i18n/zh-CN/features/step_definitons/calculator_steps.rb
aslakhellesoy-cucumber-0.1.100.5 examples/i18n/zh-CN/features/step_definitons/calculator_steps.rb
aslakhellesoy-cucumber-0.1.16.5 examples/i18n/zh-CN/features/step_definitons/calculator_steps.rb
aslakhellesoy-cucumber-0.1.99.1 examples/i18n/zh-CN/features/step_definitons/calculator_steps.rb
aslakhellesoy-cucumber-0.1.99.10 examples/i18n/zh-CN/features/step_definitons/calculator_steps.rb
aslakhellesoy-cucumber-0.1.99.11 examples/i18n/zh-CN/features/step_definitons/calculator_steps.rb
aslakhellesoy-cucumber-0.1.99.12 examples/i18n/zh-CN/features/step_definitons/calculator_steps.rb
aslakhellesoy-cucumber-0.1.99.13 examples/i18n/zh-CN/features/step_definitons/calculator_steps.rb
aslakhellesoy-cucumber-0.1.99.14 examples/i18n/zh-CN/features/step_definitons/calculator_steps.rb
aslakhellesoy-cucumber-0.1.99.15 examples/i18n/zh-CN/features/step_definitons/calculator_steps.rb
aslakhellesoy-cucumber-0.1.99.17 examples/i18n/zh-CN/features/step_definitons/calculator_steps.rb
aslakhellesoy-cucumber-0.1.99.18 examples/i18n/zh-CN/features/step_definitons/calculator_steps.rb
aslakhellesoy-cucumber-0.1.99.19 examples/i18n/zh-CN/features/step_definitons/calculator_steps.rb
aslakhellesoy-cucumber-0.1.99.2 examples/i18n/zh-CN/features/step_definitons/calculator_steps.rb
aslakhellesoy-cucumber-0.1.99.20 examples/i18n/zh-CN/features/step_definitons/calculator_steps.rb
aslakhellesoy-cucumber-0.1.99.21 examples/i18n/zh-CN/features/step_definitons/calculator_steps.rb
aslakhellesoy-cucumber-0.1.99.22 examples/i18n/zh-CN/features/step_definitons/calculator_steps.rb