[jbehave-dev] [jira] Closed: (JBEHAVE-119) DollarArgThingumy should take the $ as an argument - this is what people are most likely to want to change
[ http://jira.codehaus.org/browse/JBEHAVE-119?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Elizabeth Keogh closed JBEHAVE-119. --- Resolution: Fixed > DollarArgThingumy should take the $ as an argument - this is what people are > most likely to want to change > -- > > Key: JBEHAVE-119 > URL: http://jira.codehaus.org/browse/JBEHAVE-119 > Project: JBehave > Issue Type: Improvement >Reporter: Elizabeth Keogh > Fix For: 2.0 > > -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email
[jbehave-dev] [jira] Closed: (JBEHAVE-121) Only Parentheses are escaped in DollarStepPatternBuilder
[ http://jira.codehaus.org/browse/JBEHAVE-121?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Elizabeth Keogh closed JBEHAVE-121. --- Resolution: Fixed Fix Version/s: 2.0 Fixed, now works for all the above and \ > Only Parentheses are escaped in DollarStepPatternBuilder > > > Key: JBEHAVE-121 > URL: http://jira.codehaus.org/browse/JBEHAVE-121 > Project: JBehave > Issue Type: Bug > Components: Core >Affects Versions: 2.0 >Reporter: Michael Hunger > Fix For: 2.0 > > > DollarStepPatternBuilder escapes only () of all regexp characters leading to > failing patterns when applied later or to patterns matching stuff that is not > intented. > Other Regexp Chars that should be escaped: []{}?^.*+ -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email
[jbehave-scm] [877] trunk/jbehave-core/src/java/org/jbehave/scenario/steps: [Liz]: DollarStepPatternBuilder -> PrefixCapturingPatternBuilder, can configure with a prefix; also escapes all regexp char
Title: [877] trunk/jbehave-core/src/java/org/jbehave/scenario/steps: [Liz]: DollarStepPatternBuilder -> PrefixCapturingPatternBuilder, can configure with a prefix; also escapes all regexp characters Revision 877 Author sirenian Date 2008-07-24 07:53:56 -0500 (Thu, 24 Jul 2008) Log Message [Liz]: DollarStepPatternBuilder -> PrefixCapturingPatternBuilder, can configure with a prefix; also escapes all regexp characters Modified Paths trunk/jbehave-core/src/behaviour/org/jbehave/scenario/steps/CandidateStepBehaviour.java trunk/jbehave-core/src/java/org/jbehave/scenario/steps/StepPatternBuilder.java trunk/jbehave-core/src/java/org/jbehave/scenario/steps/Steps.java Added Paths trunk/jbehave-core/src/behaviour/org/jbehave/scenario/steps/PrefixCapturingPatternBuilderBehaviour.java trunk/jbehave-core/src/java/org/jbehave/scenario/steps/PrefixCapturingPatternBuilder.java Removed Paths trunk/jbehave-core/src/behaviour/org/jbehave/scenario/steps/DollarStepPatternBuilderBehaviour.java trunk/jbehave-core/src/java/org/jbehave/scenario/steps/DollarStepPatternBuilder.java Diff Modified: trunk/jbehave-core/src/behaviour/org/jbehave/scenario/steps/CandidateStepBehaviour.java (876 => 877) --- trunk/jbehave-core/src/behaviour/org/jbehave/scenario/steps/CandidateStepBehaviour.java 2008-07-22 17:11:43 UTC (rev 876) +++ trunk/jbehave-core/src/behaviour/org/jbehave/scenario/steps/CandidateStepBehaviour.java 2008-07-24 12:53:56 UTC (rev 877) @@ -11,7 +11,7 @@ public class CandidateStepBehaviour { -private static final StepPatternBuilder PATTERN_BUILDER = new DollarStepPatternBuilder(); +private static final StepPatternBuilder PATTERN_BUILDER = new PrefixCapturingPatternBuilder(); private static final StepMonitor MONITOR = new SilentStepMonitor(); private static final String NL = System.getProperty("line.separator"); Deleted: trunk/jbehave-core/src/behaviour/org/jbehave/scenario/steps/DollarStepPatternBuilderBehaviour.java (876 => 877) --- trunk/jbehave-core/src/behaviour/org/jbehave/scenario/steps/DollarStepPatternBuilderBehaviour.java 2008-07-22 17:11:43 UTC (rev 876) +++ trunk/jbehave-core/src/behaviour/org/jbehave/scenario/steps/DollarStepPatternBuilderBehaviour.java 2008-07-24 12:53:56 UTC (rev 877) @@ -1,67 +0,0 @@ -package org.jbehave.scenario.steps; - -import static org.hamcrest.CoreMatchers.equalTo; -import static org.jbehave.Ensure.ensureThat; - -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import org.junit.Test; - - -public class DollarStepPatternBuilderBehaviour { - - private static final String NL = System.getProperty("line.separator"); - - @Test - public void shouldReplaceAllDollarArgumentsWithCaptures() { - StepPatternBuilder builder = new DollarStepPatternBuilder(); - ensureThat(builder.buildPattern("a house with $numberOfDoors doors and $some windows").matcher("a house with 3 doors and 4 windows").matches()); - ensureThat(builder.buildPattern("the house on $street").matcher("the house on Easy Street").matches()); - ensureThat(builder.buildPattern("$number houses").matcher("5 houses").matches()); - ensureThat(builder.buildPattern("my house").matcher("my house").matches()); - } - - @Test - public void shouldEscapeExistingBrackets() { - StepPatternBuilder matcher = new DollarStepPatternBuilder(); - ensureThat(matcher.buildPattern("I toggle the cell at ($column, $row)").matcher("I toggle the cell at (3, 4)").matches()); - } - - @Test - public void shouldNotCareSoMuchAboutWhitespace() { - StepPatternBuilder matcher = new DollarStepPatternBuilder(); - Pattern pattern = matcher.buildPattern("The grid looks like $grid"); - - // Given an argument on a new line - Matcher matched = pattern.matcher( -"The grid looks like" + NL + -".." + NL + -".." + NL -); - ensureThat(matched.matches()); - ensureThat(matched.group(1), equalTo( -".." + NL + -".." + NL)); - - // Given an argument on a new line with extra spaces - matched = pattern.matcher( -"The grid looks like " + NL + -".." + NL + -".." + NL -); - ensureThat(matched.matches()); - ensureThat(matched.group(1), equalTo( -".." + NL + -".." + NL)); - - // Given an argument with extra spaces - matched = pattern.matcher( -"The grid looks like ."); - ensureThat(matched.matches()); - ensureThat(matched.group(1), equalTo( -".")); - - } - -} Added: trunk/jbehave-core/src/behaviour/org/jbehave/scenario/steps/PrefixCapturingPatternBuilderBehaviour.java (0 => 877) --- trunk/jbehave-core/src/behaviour/org/jbehave/scenario/steps/PrefixCapturingPatternBuilderBehaviour.java (rev 0) +++ trunk/jbehave-core/src/behaviour/org/jbehave/scenario/steps/PrefixCapturingPatternBuilderBehaviour.java 2008-07-24 12:53:56 UTC (rev 877) @@ -0,0 +1,75 @@ +package org.jbehave.scenario.steps; + +import static org.hamcrest.CoreMatchers.equalTo; +import static org.jbehave.Ensure.ensureThat; + +import java.util.regex.Matcher; +im
[jbehave-dev] [jira] Closed: (JBEHAVE-122) Newline escape has the wrong order of \n\r
[ http://jira.codehaus.org/browse/JBEHAVE-122?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Elizabeth Keogh closed JBEHAVE-122. --- Resolution: Not A Bug I tried this, and it didn't work (failed on my Windows machine, anyway). See: http://en.wikipedia.org/wiki/Newline - \r\n appears to be right. If for some reason it's failing for you, please could you output the stack trace, including the text from the failing expectation? Thanks! > Newline escape has the wrong order of \n\r > -- > > Key: JBEHAVE-122 > URL: http://jira.codehaus.org/browse/JBEHAVE-122 > Project: JBehave > Issue Type: Bug >Reporter: Michael Hunger > > CandidateStep > value.replaceAll("(\n)|(\r\n)", System.getProperty("line.separator")); > must be: > value.replaceAll("(\n)|(\n\r)", System.getProperty("line.separator")); -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email
[jbehave-dev] [jira] Created: (JBEHAVE-123) JBehave configuration classes
JBehave configuration classes - Key: JBEHAVE-123 URL: http://jira.codehaus.org/browse/JBEHAVE-123 Project: JBehave Issue Type: New Feature Reporter: Elizabeth Keogh Fix For: 2.0 I'm starting to find that there are multiple different things I might want to do, and the dependency injection mechanism isn't really working as well as I'd like for this. It would be nice to produce a configuration that's easy to set up, and use that for everything. We could then have different ways of configuring JBehave, eg: environment-driven, settable, null (so you have to specify everything yourself), etc. Going to have a play with this, driving it using the "broken scenarios only". BTW, every time I get a "broken scenario" or "error output" story, I'm driving it by actually breaking a story. You won't see these broken stories checked into the build, but it's easy enough to replicate yourself! -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email
[jbehave-dev] [jira] Closed: (JBEHAVE-120) Single $ without name are allowed
[ http://jira.codehaus.org/browse/JBEHAVE-120?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Elizabeth Keogh closed JBEHAVE-120. --- Resolution: Won't Fix I'm not worried; it strikes me that "The grid should look like $" or "When I create a cell at ($, $)" are actually nice shorthands and perfectly valid. > Single $ without name are allowed > - > > Key: JBEHAVE-120 > URL: http://jira.codehaus.org/browse/JBEHAVE-120 > Project: JBehave > Issue Type: Bug > Components: Core >Affects Versions: 2.0 >Reporter: Michael Hunger >Priority: Minor > > The regexp in DollarStepPatternBuilder allows for empty markers in the match? > (\$\w*)(\W|\Z) > should the marker not at least have one (or n) chars of length? -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email