Skip to content

Commit

Permalink
New Snippet text, closes #618.
Browse files Browse the repository at this point in the history
Change to the new Snippet text. Update History.md.
Fix a one off error in JRubySnippet.java.
  • Loading branch information
brasmusson committed Nov 2, 2013
1 parent b7045ce commit 7cb3269
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/test/java/cucumber/runtime/groovy/GroovySnippetTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class GroovySnippetTest {
public void generatesPlainSnippet() {
String expected = "" +
"Given(~'^I have (\\\\d+) cukes in my \"([^\"]*)\" belly$') { int arg1, String arg2 ->\n" +
" // Express the Regexp above with the code you wish you had\n" +
" // Write code here that turns the phrase above into concrete actions\n" +
" throw new PendingException()\n" +
"}\n";
assertEquals(expected, snippetFor("I have 4 cukes in my \"big\" belly"));
Expand All @@ -31,7 +31,7 @@ public void generatesPlainSnippet() {
public void generatesCopyPasteReadyStepSnippetForNumberParameters() throws Exception {
String expected = "" +
"Given(~'^before (\\\\d+) after$') { int arg1 ->\n" +
" // Express the Regexp above with the code you wish you had\n" +
" // Write code here that turns the phrase above into concrete actions\n" +
" throw new PendingException()\n" +
"}\n";
String snippet = snippetFor("before 5 after");
Expand All @@ -42,7 +42,7 @@ public void generatesCopyPasteReadyStepSnippetForNumberParameters() throws Excep
public void generatesCopyPasteReadySnippetWhenStepHasIllegalJavaIdentifierChars() {
String expected = "" +
"Given(~'^I have (\\\\d+) cukes in: my \"([^\"]*)\" red-belly!$') { int arg1, String arg2 ->\n" +
" // Express the Regexp above with the code you wish you had\n" +
" // Write code here that turns the phrase above into concrete actions\n" +
" throw new PendingException()\n" +
"}\n";
assertEquals(expected, snippetFor("I have 4 cukes in: my \"big\" red-belly!"));
Expand All @@ -53,7 +53,7 @@ public void generatesCopyPasteReadySnippetWhenStepHasIllegalJavaIdentifierChars(
public void generatesCopyPasteReadySnippetWhenStepHasIntegersInsideStringParameter() {
String expected = "" +
"Given(~'^the DI system receives a message saying \"([^\"]*)\"$') { String arg1 ->\n" +
" // Express the Regexp above with the code you wish you had\n" +
" // Write code here that turns the phrase above into concrete actions\n" +
" throw new PendingException()\n" +
"}\n";
assertEquals(expected, snippetFor("the DI system receives a message saying \"{ dataIngestion: { feeds: [ feed: { merchantId: 666, feedId: 1, feedFileLocation: feed.csv } ] }\""));
Expand All @@ -63,7 +63,7 @@ public void generatesCopyPasteReadySnippetWhenStepHasIntegersInsideStringParamet
public void generatesSnippetWithEscapedDollarSigns() {
String expected = "" +
"Given(~'^I have \\\\$(\\\\d+)$') { int arg1 ->\n" +
" // Express the Regexp above with the code you wish you had\n" +
" // Write code here that turns the phrase above into concrete actions\n" +
" throw new PendingException()\n" +
"}\n";
assertEquals(expected, snippetFor("I have $5"));
Expand All @@ -73,7 +73,7 @@ public void generatesSnippetWithEscapedDollarSigns() {
public void generatesSnippetWithEscapedParentheses() {
String expected = "" +
"Given(~'^I have (\\\\d+) cukes \\\\(maybe more\\\\)$') { int arg1 ->\n" +
" // Express the Regexp above with the code you wish you had\n" +
" // Write code here that turns the phrase above into concrete actions\n" +
" throw new PendingException()\n" +
"}\n";
assertEquals(expected, snippetFor("I have 5 cukes (maybe more)"));
Expand All @@ -83,7 +83,7 @@ public void generatesSnippetWithEscapedParentheses() {
public void generatesSnippetWithEscapedBrackets() {
String expected = "" +
"Given(~'^I have (\\\\d+) cukes \\\\[maybe more\\\\]$') { int arg1 ->\n" +
" // Express the Regexp above with the code you wish you had\n" +
" // Write code here that turns the phrase above into concrete actions\n" +
" throw new PendingException()\n" +
"}\n";
assertEquals(expected, snippetFor("I have 5 cukes [maybe more]"));
Expand All @@ -93,7 +93,7 @@ public void generatesSnippetWithEscapedBrackets() {
public void generatesSnippetWithDocString() {
String expected = "" +
"Given(~'^I have:$') { String arg1 ->\n" +
" // Express the Regexp above with the code you wish you had\n" +
" // Write code here that turns the phrase above into concrete actions\n" +
" throw new PendingException()\n" +
"}\n";
assertEquals(expected, snippetForDocString("I have:", new DocString("text/plain", "hello", 1)));
Expand All @@ -103,7 +103,7 @@ public void generatesSnippetWithDocString() {
public void generatesSnippetWithDataTable() {
String expected = "" +
"Given(~'^I have:$') { DataTable arg1 ->\n" +
" // Express the Regexp above with the code you wish you had\n" +
" // Write code here that turns the phrase above into concrete actions\n" +
" throw new PendingException()\n" +
"}\n";
List<DataTableRow> dataTable = asList(new DataTableRow(NO_COMMENTS, asList("col1"), 1));
Expand All @@ -114,7 +114,7 @@ public void generatesSnippetWithDataTable() {
public void generateSnippetWithEscapedEscapeCharacter() {
String expected = "" +
"Given(~'^I have (\\\\d+) cukes in my belly$') { int arg1 ->\n" +
" // Express the Regexp above with the code you wish you had\n" +
" // Write code here that turns the phrase above into concrete actions\n" +
" throw new PendingException()\n" +
"}\n";

Expand Down

0 comments on commit 7cb3269

Please sign in to comment.