- Revision
- 1014
- Author
- mauro
- Date
- 2008-12-14 13:13:56 -0600 (Sun, 14 Dec 2008)
Log Message
JBEHAVE-154: Moved separation ":" to scenario keyword.
Modified Paths
Diff
Modified: trunk/examples/noughtsandcrosses/src/scenario/com/lunivore/noughtsandcrosses/PlayersCanHazTurns.java (1013 => 1014)
--- trunk/examples/noughtsandcrosses/src/scenario/com/lunivore/noughtsandcrosses/PlayersCanHazTurns.java 2008-11-29 16:54:30 UTC (rev 1013) +++ trunk/examples/noughtsandcrosses/src/scenario/com/lunivore/noughtsandcrosses/PlayersCanHazTurns.java 2008-12-14 19:13:56 UTC (rev 1014) @@ -28,7 +28,7 @@ public PlayersCanHazTurns(final ClassLoader classLoader, OAndXUniverse universe) { super(new MostUsefulConfiguration() { public KeyWords keywords() { - return new KeyWords("I can haz", "Gief", "Wen", "Den", "And"); + return new KeyWords("I can haz:", "Gief", "Wen", "Den", "And"); } public ClasspathScenarioDefiner forDefiningScenarios() { return new ClasspathScenarioDefiner(new UnderscoredCamelCaseResolver(), new PatternScenarioParser(this),
Modified: trunk/jbehave-core/src/java/org/jbehave/scenario/definition/ScenarioGivenWhenThenAnd.java (1013 => 1014)
--- trunk/jbehave-core/src/java/org/jbehave/scenario/definition/ScenarioGivenWhenThenAnd.java 2008-11-29 16:54:30 UTC (rev 1013) +++ trunk/jbehave-core/src/java/org/jbehave/scenario/definition/ScenarioGivenWhenThenAnd.java 2008-12-14 19:13:56 UTC (rev 1014) @@ -3,7 +3,7 @@ public class ScenarioGivenWhenThenAnd extends KeyWords { public ScenarioGivenWhenThenAnd() { - super("Scenario", "Given", "When", "Then", "And"); + super("Scenario:", "Given", "When", "Then", "And"); } }
Modified: trunk/jbehave-core/src/java/org/jbehave/scenario/parser/PatternScenarioParser.java (1013 => 1014)
--- trunk/jbehave-core/src/java/org/jbehave/scenario/parser/PatternScenarioParser.java 2008-11-29 16:54:30 UTC (rev 1013) +++ trunk/jbehave-core/src/java/org/jbehave/scenario/parser/PatternScenarioParser.java 2008-12-14 19:13:56 UTC (rev 1014) @@ -57,7 +57,7 @@ } private Blurb parseBlurbFrom(String wholeStoryAsString) { - Pattern findStoryBlurb = Pattern.compile("(.*?)(" + configuration.keywords().scenario() + ":).*", + Pattern findStoryBlurb = Pattern.compile("(.*?)(" + configuration.keywords().scenario() + ").*", Pattern.DOTALL); Matcher matcher = findStoryBlurb.matcher(wholeStoryAsString); if (matcher.find()) { @@ -85,14 +85,14 @@ } private Pattern patternToPullScenariosIntoGroupFour() { - return Pattern.compile(".*?((Scenario:) (.|\\s)*?)\\s*(\\Z|Scenario:).*".replace("Scenario", configuration + return Pattern.compile(".*?((Scenario) (.|\\s)*?)\\s*(\\Z|Scenario).*".replace("Scenario", configuration .keywords().scenario()), Pattern.DOTALL); } private Pattern patternToPullScenarioTitlesIntoGroupOne() { String concatenatedKeywords = concatenateWithOr(configuration.keywords().given(), configuration.keywords() .when(), configuration.keywords().then(), configuration.keywords().others()); - return Pattern.compile(configuration.keywords().scenario() + ":(.*?)\\s*(" + concatenatedKeywords + ").*"); + return Pattern.compile(configuration.keywords().scenario() + "(.*?)\\s*(" + concatenatedKeywords + ").*"); } private String concatenateWithOr(String given, String when, String then, String[] others) { @@ -134,6 +134,6 @@ String givenWhenThenSpaced = concatenateWithSpaceOr(configuration.keywords().given(), configuration.keywords().when(), configuration.keywords().then(), configuration.keywords().others()); return Pattern.compile("((" + givenWhenThen + ") (.|\\s)*?)\\s*(\\Z|" + givenWhenThenSpaced + "|" - + configuration.keywords().scenario() + ":)"); + + configuration.keywords().scenario() + ")"); } }
To unsubscribe from this list please visit:
