= Aruba
aruba-jbb is a fork of http://github.com/aslakhellesoy/aruba
Aruba is a set of api methods and cucumber steps for driving out command
line applications. The command line application can be anything, a compiled
C program, a Java program, a Perl script - anything.
Aruba may also be used to test complex configuration files for third-party
applications where the software itself may not be modified.
Aruba provides support for testing using various Ruby versions (see below).
== Usage
gem install aruba-jbb
Then, just require the library in one of your Ruby files under
features/support
require 'aruba' # note that aruba-jbb and aruba cannot co-exist
You now have a bunch of step definitions that you can use in your features.
Look at aruba/cucumber_steps.rb to see all the step definitions. Look at
features/*.feature for examples (which are also testing Aruba itself).
You should be aware that Aruba runs the application it tests and creates
all local output in its own working directory (awd). The awd defaults to
tmp/aruba and is purged and created by Aruba at the beginning of
every Scenario. However, the contents created by the last Scenario
are left in the awd for your inspection.
If it is desired to alter the awd then this fork provides for setting the
working directory to something else via the ARUBA_WORKING_DIR environmental
variable. This must be set relative to the user's cwd.
This fork also contains a rebase api method which creates soft
(symbolic) links inside aruba's working directory to directories rooted
at the user's own current working directory (cwd). This permits the
application to find its configuation and support files in their usual
directories. A string of directories to rebase also may be passed by
setting the ARUBA_REBASE environmental variable. These must be set relative
to the user's cwd as well.
For example:
ARUBA_REBASE="bin,config,lib"
This will cause Aruba to create soft links called ./tmp/aruba/bin,
./tmp/aruba/config and ./tmp/aruba/lib each pointing
to the corresponding directory in the user's cwd.
This fork also provides support for a @no-aruba-tmpdir tag. Use of
this tag will cause Aruba to run the test application in the user's cwd
instead of the awd. When this tag is activated the directory contents are not
cleared, for obvious reasons. In fact, if the awd is set to anything outside
a directory tree containing a /tmp/ portion then an error is raised
when trying to clear the contents. For similar reasons, when this is the case
the rebase method also raises an error.
== Ruby/RVM love
Aruba has a couple of step definitions that make it easier to test your
Ruby command line program with specific versions of Ruby (regardless of
what Ruby version you're using to invoke Cucumber).
This is done with the follwoing step definitions:
/^I am using rvm "([^"]*)"$/
/^I am using rvm gemset "([^"]*)"$/
Then, if you use the step definition:
/^I run "(.*)"$/
.. with a command that starts with ruby, Aruba will actually invoke
the Ruby version (and gemset if you specified) instead of just ruby,
which would be the one on your PATH, which might not be the one you
want. The same goes for commands starting with bundle,
cucumber, gem, jeweler, rails,
rake, rspec and spec -
they can all be run with a particular Ruby version that you specify.
See features/running_ruby.feature for examples.
== Getting more output with tags.
Aruba has several tags you can use to see what command actually gets run
(useful if you're using the RVM steps), STDOUT or STDERR. You can put these
tags on individual scenarios, or on a feature. The tags are:
* @announce-cmd
* @announce-stdout
* @announce-stderr
* @announce (does all of the above)
== Note on Patches/Pull Requests
* Fork the project.
* Make your feature addition or bug fix.
* Add tests for it. This is important so I don't break it in a
future version unintentionally.
* Commit, do not mess with rakefile, version, or history.
(if you want to have your own version, that is fine but bump
version in a commit by itself I can ignore when I pull)
* Send me a pull request. Bonus points for topic branches.
== Note on Aruba-JBB Step Definitions
This fork has extensively refactoried both the API and the Step
Definitions. There is some breakage with the step definitions
provided with the parent. Mostly these have to do with making
Aruba-jbb steps more specific so as to avoid anticipated collisions
with the user's own steps. On the other hand, most Aruba-jbb steps
are defined as sub strings so that the subject is no longer part of
the matcher. For example, instead of:
When /^I have a file named "([^\"]*)"$/ do |file|
This fork uses:
When /do have a file named "([^\"]*)"$/ do |file|
So in your features you can write this:
When I do have a file named "test"
. . .
When we do have a file named "test"
. . .
When they do have a file named "test"
== Note on Aruba-JBB Development Testing
This fork has not tested the JRuby features. It has also disabled
RCov in the Rake file and removed dependencies on beta versions of
RSpec.
There is a problem with loading Ruby libraries from rake which causes
Gherkin not to be found by Cucumber when Aruba features are exercised
using Rake (rake or rake cucumber). Nonetheless, all
features not using JRuby pass when exercised using cucumber features.
You can contact me at byrnejb@jharte-lyne.ca. I also monitor the
cukes@googlegroups.com mailing list.
== Note on Cucumber-Rails
I have renamed this gem since it has now evolved considerably away
from the baseline although, in the main, compatiblity between the
the two remains quite high. Nonetheless, to avoid collisions Aruba
must be removed (or uninstalled) if you wish to use Aruba-jbb.
However, Cucumber-Rails v0.3.2 has a dependency on Aruba which will
result in the Aruba baseline gem being installed whenever
Cucumber-Rails is installed or updated. Therefore the baseline Aruba
gem must be removed after updating Cucumber-Rails and the dependency
warning ignored.
== Copyright
Copyright (c) 2010 Aslak Hellesøy and David Chelimsky. See LICENSE for details.
Portions copyright (c) 2010 James B. Byrne. Released under the same LICENSE.