forked from dchelimsky/rspec
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
19cb60b
commit 9060150
Showing
3 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |