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 UI/UX Design

UI/UX Design by makandra brand

We make sure that your target audience has the best possible experience with your digital product. You get:

  • Design tailored to your audience
  • Proven processes customized to your needs
  • An expert team of experienced designers
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)