- Revision
- 1658
- Author
- mauro
- Date
- 2010-06-07 17:02:23 -0500 (Mon, 07 Jun 2010)
Log Message
Improved test of parsing given scenarios. Updated release notes.
Modified Paths
- trunk/core/distribution/src/site/content/release-notes.html
- trunk/core/jbehave-core/src/behaviour/java/org/jbehave/scenario/parser/PatternScenarioParserBehaviour.java
Diff
Modified: trunk/core/distribution/src/site/content/release-notes.html (1657 => 1658)
--- trunk/core/distribution/src/site/content/release-notes.html 2010-06-05 14:55:33 UTC (rev 1657) +++ trunk/core/distribution/src/site/content/release-notes.html 2010-06-07 22:02:23 UTC (rev 1658) @@ -5,7 +5,7 @@ </head> <body> -<h1>JBehave Core - Version 2.5.9 (Jun xx, 2010)</h1> +<h1>JBehave Core - Version 2.5.9 (Jun 7, 2010)</h1> <h2> Improvement </h2>
Modified: trunk/core/jbehave-core/src/behaviour/java/org/jbehave/scenario/parser/PatternScenarioParserBehaviour.java (1657 => 1658)
--- trunk/core/jbehave-core/src/behaviour/java/org/jbehave/scenario/parser/PatternScenarioParserBehaviour.java 2010-06-05 14:55:33 UTC (rev 1657) +++ trunk/core/jbehave-core/src/behaviour/java/org/jbehave/scenario/parser/PatternScenarioParserBehaviour.java 2010-06-07 22:02:23 UTC (rev 1658) @@ -293,26 +293,26 @@ @Test public void shouldParseStoryWithGivenScenarios() { - String wholeStory = - "Scenario: A scenario with given scenarios" + NL + NL + - "GivenScenarios: path/to/one , "+ NL + " path/to/two" + NL + NL + - "Given a step with a <one>" + NL + - "When I run the scenario of name <two>" + NL + - "Then I should see <three> in the output"; - - StoryDefinition story = parser.defineStoryFrom(wholeStory, null); + // no newlines or spaces in CSV + parseStoryWithGivenScenarios( + "GivenScenarios: path/to/one,path/to/two" + NL + + "Given a step with a <one>"); + + // newlines and spaces in CSV + parseStoryWithGivenScenarios( + "GivenScenarios: path/to/one , "+ NL + " path/to/two" + NL + NL + + "Given a step with a <one>"); + } + + private void parseStoryWithGivenScenarios(String wholeStory) { + StoryDefinition story = parser.defineStoryFrom(wholeStory, null); ScenarioDefinition scenario = story.getScenarios().get(0); - ensureThat(scenario.getTitle(), equalTo("A scenario with given scenarios")); ensureThat(scenario.getGivenScenarios(), equalTo(asList( "path/to/one", "path/to/two"))); ensureThat(scenario.getSteps(), equalTo(asList( - "Given a step with a <one>", - "When I run the scenario of name <two>", - "Then I should see <three> in the output" - ))); - + "Given a step with a <one>"))); } }
To unsubscribe from this list please visit:
