-
Notifications
You must be signed in to change notification settings - Fork 72
Command Line
Starting with version 0.2.1, Cuke4Duke has a standalone command line. This is handy if you don’t want to use Ant or Maven.
The cuke4duke
command line is a gem with an executable script. To use it you must first install JRuby
When that’s sorted, install the cuke4duke gem:
jruby -S gem install cuke4duke
Now you should be able to run cuke4duke from the command line:
cuke4duke --version cuke4duke --help
As you see, you have the same command line options as cucumber
. (Since you’re running on JRuby you also have a new option: --jars
that is explained below).
Since you’re using cuke4duke you probably have some jar files that need to be on the CLASSPATH. These can be specified with the --jars
option. The argument passed to the --jars
option must be a directory (and not a jar file). You may specify this option several times if you have jar files scattered around. (cuke4duke will add each jar file to the $CLASSPATH
ruby constant).
If you are using cuke4duke with Scala or Java you will also have compiled .class
files that need to be loaded. Use --require
to load these. The argument given to --require
must be the top level directory of your classes (the package names shoud start right underneath it). Dynamic programming languages that are supported by cuke4duke shouldn’t have to use this option if the step definition files are under features/step_definitions
.
For example, if you want to run the Java examples, try this command:
cuke4duke --jars lib --require target/test-classes features
Or the Javascript ones:
cuke4duke --jars lib features