Skip to content

Commit

Permalink
Update snippets to new syntax. See #267
Browse files Browse the repository at this point in the history
  • Loading branch information
aslakhellesoy committed Mar 19, 2012
1 parent 8343bd2 commit 999f21d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
7 changes: 3 additions & 4 deletions clojure/src/main/clj/cucumber/runtime/clj.clj
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@
Snippet
(template [_]
(str
"({0} #\"{1}\"\n"
" (fn [{3}]\n"
" '' {4}\n"
" ))\n"))
"({0} #\"{1}\" [{3}]\n"
" '' {4}\n"
" )\n"))
(arguments [_ argumentTypes]
(SnippetGenerator/untypedArguments argumentTypes))
(namedGroupStart [_] nil)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@
public class ClojureSnippet implements Snippet {
@Override
public String template() {
return "({0} #\"{1}\"\n" +
" (fn [{3}]\n" +
" '' {4}\n" +
" ))\n";
return "({0} #\"{1}\" [{3}]\n" +
" '' {4}\n" +
" )\n";
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@ public void generatesPlainSnippet() {
Step step = new Step(Collections.<Comment>emptyList(), "Given ", "I have 4 cukes in my \"big\" belly", 0, null, null);
String snippet = new SnippetGenerator(new ClojureSnippet()).getSnippet(step);
String expected = "" +
"(Given #\"^I have (\\d+) cukes in my \"([^\"]*)\" belly$\"\n" +
" (fn [arg1, arg2]\n" +
" ' Express the Regexp above with the code you wish you had\n" +
" ))\n";
"(Given #\"^I have (\\d+) cukes in my \"([^\"]*)\" belly$\" [arg1, arg2]\n" +
" ' Express the Regexp above with the code you wish you had\n" +
" )\n";
assertEquals(expected, snippet);
}
}

0 comments on commit 999f21d

Please sign in to comment.