Aruba: Stubbing binaries

When testing your command line application with Aruba Show archive.org snapshot , you might need to stub out other binaries you don't want to be invoked by your test.

Aruba Doubles is a library that was built for this purpose. It is not actively maintained, but works with the little fix below.

Installation

Install the gem as instructed by its README, then put this Before block somewhere into features/support:

Before do
  ArubaDoubles::Double.setup
  prepend_environment_variable 'PATH', ArubaDoubles::Double.bindir + ':'
end

This is required because the way Aruba Doubles patches the PATH environment variable is not supported (i.e. not noticed) by modern Arubas. By using Aruba's offical API method prepend_environment_variable, everything is in place.

Dominik Schöler