Cucumber

Ruby code posted by murphy < cucumber
created at 22 Feb 03:20

Edit | Back
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# encoding: utf-8
require 'spec/expectations'
require 'cucumber/formatter/unicode'
$:.unshift(File.dirname(__FILE__) + '/../../lib')
require 'calculator'
 
Before do
  @calc = Calculator.new
end
 
After do
end
 
Given /ich habe (\d+) in den Taschenrechner eingegeben/ do |n|
  @calc.push n.to_i
end
 
When /ich (\w+) drücke/ do |op|
  @result = @calc.send op
end
 
Then /sollte das Ergebniss auf dem Bildschirm (.*) sein/ do |result|
  @result.should == result.to_f
end
493 Bytes in 4 ms with coderay