Sha256: 8646b02f154d8701e6f3924be65c34bc0c71448ce8de981550009cea1b3e6dc8

Contents?: true

Size: 551 Bytes

Versions: 4

Compression:

Stored size: 551 Bytes

Contents

require 'spec'

class Kalkulaator
  def push(n)
    @args ||= []
    @args << n
  end
  
  def liida
    @args.inject(0) {|n,sum| sum+n}
  end
end

Before do
  @calc = Kalkulaator.new
end

After do
end

Given /olen sisestanud kalkulaatorisse numbri (\d+)/ do |n|
  @calc.push n.to_i
end

When /ma vajutan (.*)/ do |op|
  @result = @calc.send op
end

Then /vastuseks peab ekraanil kuvatama (\d*)/ do |result|
  @result.should == result.to_i
end

Then /vastuseklass peab olema tüüpi (\w*)/ do |class_name|
  @result.class.name.should == class_name
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
elight-cucumber-0.1.9 examples/estonian_calculator/features/kalkulaator_steps.rb
cucumber-0.1.7 examples/estonian_calculator/features/kalkulaator_steps.rb
cucumber-0.1.6 examples/estonian_calculator/features/kalkulaator_steps.rb
cucumber-0.1.8 examples/estonian_calculator/features/kalkulaator_steps.rb