Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
aslakhellesoy committed Dec 10, 2011
1 parent beab013 commit 862a339
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
Empty file added core/report.js
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -13,42 +13,42 @@ public class JavaSnippetGeneratorTest {
@Test
public void generatesPlainSnippet() {
String expected = "" +
"@Given(\"^I have (\\\\d+) cukes in my \\\"([^\\\"]*)\\\" belly$\")\n" +
"public void I_have_cukes_in_my_belly(int arg1, String arg2) {\n" +
" // Express the Regexp above with the code you wish you had\n" +
"}\n";
"@Given(\"^I have (\\\\d+) cukes in my \\\"([^\\\"]*)\\\" belly$\")\n" +
"public void I_have_cukes_in_my_belly(int arg1, String arg2) {\n" +
" // Express the Regexp above with the code you wish you had\n" +
"}\n";
assertEquals(expected, snippetFor("I have 4 cukes in my \"big\" belly"));
}

@Test
public void generatesCopyPasteReadyStepSnippetForNumberParameters() throws Exception {
String expected = "" +
"@Given(\"^before (\\\\d+) after$\")\n" +
"public void before_after(int arg1) {\n" +
" // Express the Regexp above with the code you wish you had\n" +
"}\n";
"@Given(\"^before (\\\\d+) after$\")\n" +
"public void before_after(int arg1) {\n" +
" // Express the Regexp above with the code you wish you had\n" +
"}\n";
String snippet = snippetFor("before 5 after");
assertEquals(expected, snippet);
}

@Test
public void generatesCopyPasteReadySnippetWhenStepHasIllegalJavaIdentifierChars() {
String expected = "" +
"@Given(\"^I have (\\\\d+) cukes in: my \\\"([^\\\"]*)\\\" red-belly!$\")\n" +
"public void I_have_cukes_in_my_red_belly(int arg1, String arg2) {\n" +
" // Express the Regexp above with the code you wish you had\n" +
"}\n";
"@Given(\"^I have (\\\\d+) cukes in: my \\\"([^\\\"]*)\\\" red-belly!$\")\n" +
"public void I_have_cukes_in_my_red_belly(int arg1, String arg2) {\n" +
" // Express the Regexp above with the code you wish you had\n" +
"}\n";
assertEquals(expected, snippetFor("I have 4 cukes in: my \"big\" red-belly!"));
}


@Test
public void generatesCopyPasteReadySnippetWhenStepHasIntegersInsideStringParameter() {
String expected = "" +
"@Given(\"^the DI system receives a message saying \\\"([^\\\"]*)\\\"$\")\n" +
"public void the_DI_system_receives_a_message_saying(String arg1) {\n" +
" // Express the Regexp above with the code you wish you had\n" +
"}\n";
"@Given(\"^the DI system receives a message saying \\\"([^\\\"]*)\\\"$\")\n" +
"public void the_DI_system_receives_a_message_saying(String arg1) {\n" +
" // Express the Regexp above with the code you wish you had\n" +
"}\n";
assertEquals(expected, snippetFor("the DI system receives a message saying \"{ dataIngestion: { feeds: [ feed: { merchantId: 666, feedId: 1, feedFileLocation: feed.csv } ] }\""));
}

Expand Down

0 comments on commit 862a339

Please sign in to comment.