Skip to content

Commit

Permalink
more files from last commit
Browse files Browse the repository at this point in the history
  • Loading branch information
dchelimsky committed May 30, 2008
1 parent 19cb60b commit 9060150
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
22 changes: 22 additions & 0 deletions stories/stories/multiline_steps.story
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Story: story parser should handle multiline text

As an rspec user
I want to write steps in stories that have multiline arguments

Scenario: two lines

Given I have a two line step with this text:
This is the first line
# This, by the way, is just a comment
plus this is the second line

# This, by the way, is just a comment

When I have a When with the same two lines:
This is the first line
plus this is the second line

Then it should match:
This is the first line
plus this is the second line

12 changes: 12 additions & 0 deletions stories/stories/steps/multiline_steps.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
steps_for :multiline_steps do
Given "I have a two line step with this text:$text" do |text|
@text = text
end

When "I have a When with the same two lines:$text" do |text|
end

Then "it should match:$text" do |text|
text.should == @text
end
end
6 changes: 6 additions & 0 deletions stories/stories/stories.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
require File.join(File.dirname(__FILE__), *%w[.. helper])
require File.join(File.dirname(__FILE__), *%w[steps multiline_steps])

with_steps_for :multiline_steps do
run File.dirname(__FILE__) + "/multiline_steps.story"
end

0 comments on commit 9060150

Please sign in to comment.