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