Title: [1497] trunk/core/jbehave-core/src/main/java/org/jbehave/scenario/steps: Ensure matched regex group values are converted to unix newlines.
Revision
1497
Author
mauro
Date
2010-01-05 10:28:33 -0600 (Tue, 05 Jan 2010)

Log Message

Ensure matched regex group values are converted to unix newlines.

Modified Paths


Diff

Modified: trunk/core/jbehave-core/src/main/java/org/jbehave/scenario/steps/CandidateStep.java (1496 => 1497)

--- trunk/core/jbehave-core/src/main/java/org/jbehave/scenario/steps/CandidateStep.java	2010-01-05 14:46:33 UTC (rev 1496)
+++ trunk/core/jbehave-core/src/main/java/org/jbehave/scenario/steps/CandidateStep.java	2010-01-05 16:28:33 UTC (rev 1497)
@@ -176,11 +176,15 @@
         for (int i = 0; i < groupNames.length; i++) {
             String groupName = groupNames[i];
             if (name.equals(groupName)) {
-                return matcher.group(i + 1);
+                return dos2unix(matcher.group(i + 1));
             }
         }
         throw new NoGroupFoundForName(name, groupNames);
     }
+    
+    private String dos2unix(String string) {
+        return string.replace("\r\n", "\n");
+    }
 
     private boolean isGroupName(String name) {
         for (String groupName : groupNames) {

Modified: trunk/core/jbehave-pico/src/behaviour/java/org/jbehave/scenario/steps/pico/PicoEnabledCandidateStepBehaviour.java (1496 => 1497)

--- trunk/core/jbehave-pico/src/behaviour/java/org/jbehave/scenario/steps/pico/PicoEnabledCandidateStepBehaviour.java	2010-01-05 14:46:33 UTC (rev 1496)
+++ trunk/core/jbehave-pico/src/behaviour/java/org/jbehave/scenario/steps/pico/PicoEnabledCandidateStepBehaviour.java	2010-01-05 16:28:33 UTC (rev 1497)
@@ -135,7 +135,6 @@
     }
 
     @Test
-    @Ignore()    
     public void shouldNotFailJustBecauseWeHaveDifferentNewlinesToTheOneTheScenarioWasWrittenIn() throws Exception {
         String windowsNewline = "\r\n";
         String unixNewline = "\n";


To unsubscribe from this list please visit:

http://xircles.codehaus.org/manage_email

Reply via email to