From 90601505dc928cb14783d8afa35e8b9221a3a2df Mon Sep 17 00:00:00 2001 From: David Chelimsky Date: Thu, 29 May 2008 17:21:12 -0700 Subject: [PATCH] more files from last commit --- stories/stories/multiline_steps.story | 22 ++++++++++++++++++++++ stories/stories/steps/multiline_steps.rb | 12 ++++++++++++ stories/stories/stories.rb | 6 ++++++ 3 files changed, 40 insertions(+) create mode 100644 stories/stories/multiline_steps.story create mode 100644 stories/stories/steps/multiline_steps.rb create mode 100644 stories/stories/stories.rb diff --git a/stories/stories/multiline_steps.story b/stories/stories/multiline_steps.story new file mode 100644 index 000000000..fcf7857d6 --- /dev/null +++ b/stories/stories/multiline_steps.story @@ -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 + diff --git a/stories/stories/steps/multiline_steps.rb b/stories/stories/steps/multiline_steps.rb new file mode 100644 index 000000000..3cf982bc3 --- /dev/null +++ b/stories/stories/steps/multiline_steps.rb @@ -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 \ No newline at end of file diff --git a/stories/stories/stories.rb b/stories/stories/stories.rb new file mode 100644 index 000000000..7a0831696 --- /dev/null +++ b/stories/stories/stories.rb @@ -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 \ No newline at end of file