Skip to content

Commit

Permalink
Throw PendingException from clojure snippets. See #271.
Browse files Browse the repository at this point in the history
  • Loading branch information
aslakhellesoy committed Mar 22, 2012
1 parent f99069e commit d2b2013
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
5 changes: 2 additions & 3 deletions clojure/src/main/clj/cucumber/runtime/clj.clj
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
(template [_]
(str
"({0} #\"{1}\" [{3}]\n"
" (comment {4} ))\n"))
" (comment {4} )\n"
" (throw (cucumber.runtime.PendingException.)))\n"))
(arguments [_ argumentTypes]
(SnippetGenerator/untypedArguments argumentTypes))
(namedGroupStart [_] nil)
Expand Down Expand Up @@ -113,8 +114,6 @@
(.eval te tags))
(getOrder [hd] 0)))))

;; TODO: before and after hooks

(defmacro step-macros [& names]
(cons 'do
(for [name names]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,7 @@

(When #"^I add (.*)$" [liquid]
(assert (= "milk" liquid)))

(Given #"^(\d+) unimplemented step$" [arg1]
(comment Express the Regexp above with the code you wish you had )
(throw (cucumber.runtime.PendingException.)))
2 changes: 1 addition & 1 deletion core/src/main/java/cucumber/runtime/Runtime.java
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ public void runStep(String uri, Step step, Reporter reporter, I18n i18n) {
match.runStep(i18n);
} catch (Throwable t) {
error = t;
status = Result.FAILED;
status = (t instanceof PendingException) ? "pending" : Result.FAILED;
addError(t);
skipNextStep = true;
} finally {
Expand Down

0 comments on commit d2b2013

Please sign in to comment.