Browse files

Added an example illustrating how to override options with cucumber.o…

  • Loading branch information...
aslakhellesoy committed Jun 12, 2012
1 parent 3090b51 commit 3f470c8c00d91268eff374c783ccc05b86168108
Showing with 12 additions and 0 deletions.
  1. +12 −0 examples/java-helloworld/
@@ -24,3 +24,15 @@ mvn test
This runs Cucumber features using the JUnit runner. The `@RunWith(Cucumber.class)` annotation on the `RunCukes` junit class
kicks off Cucumber.
+#### Overriding options
+The Cucumber runtime parses command line options to know what features to run, where the glue code lives, what formatters to use etc.
+When you use the JUnit runner, these options are generated from the `@Cucumber.Options` annotation on your test.
+Sometimes it can be useful to override these options without changing the JUnit class. This can be done with the `cucumber.options` system property. If it is specified it will override *all* options. Here is an example:
+mvn test -Dcucumber.options="--format json-pretty --glue classpath:cucumber/examples/java/helloworld src/test/resources"

0 comments on commit 3f470c8

Please sign in to comment.