Read more

How to test bundled applications using Aruba and Cucumber

Dominik Schöler
June 25, 2014Software engineer at makandra GmbH

Aruba Show archive.org snapshot is an extension to Cucumber that helps integration-testing command line tools.

Illustration online protection

Rails professionals since 2007

Our laser focus on a single technology has made us a leader in this space. Need help?

  • We build a solid first version of your product
  • We train your development team
  • We rescue your project in trouble
Read more Show archive.org snapshot

When your tests involve a Rails test application, your tool's Bundler environment will shadow that of the test application. To fix this, just call unset_bundler_env_vars in a Cucumber Before block.

Previously suggested solution

Put the snippet below into your tool's features/support/env.rb -- now any command run through Aruba (e.g. via #run_simple) will have a clean Bundler environment.

module Customization
  
  # Improve the internal #run method provided by Aruba::Api to run commands
  # with a clean bundler environment and without spring.
  def run(cmd, timeout = nil)
    ENV['DISABLE_SPRING'] = '1'
    Bundler.with_clean_env { super }
  end

end
World(Customization)

We're also disabling Spring because it does not play nicely with Aruba (see Disabling Spring when debugging).

Posted by Dominik Schöler to makandra dev (2014-06-25 14:07)