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 Long Term Support

Rails LTS provides security patches for old versions of Ruby on Rails (2.3, 3.2, 4.2 and 5.2)

  • Prevents you from data breaches and liability risks
  • Upgrade at your own pace
  • Works with modern Rubies
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)