changelog shortlog tags changeset manifest revisions annotate raw

vendor/plugins/rspec/examples/stories/steps/addition_steps.rb

changeset 15: 64acf98d15f4
author: moriq@moriq.com
date: Mon Mar 10 10:12:58 2008 +0900 (16 years ago)
permissions: -rw-r--r--
description: add plugins rspec
1require File.expand_path("#{File.dirname(__FILE__)}/../helper")
2
3# This creates steps for :addition
4steps_for(:addition) do
5 Given("an addend of $addend") do |addend|
6 @adder ||= Adder.new
7 @adder << addend.to_i
8 end
9end
10
11# This appends to them
12steps_for(:addition) do
13 When("the addends are added") { @sum = @adder.sum }
14end
15
16steps_for(:more_addition) do
17 Then("the sum should be $sum") { |sum| @sum.should == sum.to_i }
18end