]> git.openstreetmap.org Git - rails.git/blob - vendor/gems/rspec-1.1.2/examples/stories/steps/addition_steps.rb
added RSpec and RSpec on Rails
[rails.git] / vendor / gems / rspec-1.1.2 / examples / stories / steps / addition_steps.rb
1 require File.expand_path("#{File.dirname(__FILE__)}/../helper")
2
3 # This creates steps for :addition
4 steps_for(:addition) do
5   Given("an addend of $addend") do |addend|
6     @adder ||= Adder.new
7     @adder << addend.to_i
8   end
9 end
10
11 # This appends to them
12 steps_for(:addition) do
13   When("the addends are added")  { @sum = @adder.sum }
14 end
15
16 steps_for(:more_addition) do
17   Then("the sum should be $sum") { |sum| @sum.should == sum.to_i }
18 end