Test command-line applications with Cucumber-Ruby, RSpec or Minitest
Ruby Cucumber Shell
Failed to load latest commit information.
.github Take over changes to templates from cucumber May 20, 2016
bin Add console support to aruba Aug 11, 2015
config Moved configuration of rubocop to a central place May 18, 2015
doc Approve the use of window32console for the sake of making the test pass May 9, 2016
features Merge pull request #413 from scottj97/patch-2 Aug 8, 2016
fixtures Refactor documentation Jun 5, 2016
lib Remove Aruba::Reporting May 9, 2016
script Add two more helper scripts Apr 28, 2016
spec Set permissions to values which are supported on Windows May 9, 2016
.document Initial commit to aruba. Feb 12, 2010
.gitignore Improve developer experience Mar 22, 2016
.rspec Move flags from Rakefile for rspec Apr 17, 2016
.rubocop.yml Fixed offenses Mar 8, 2016
.simplecov Ignore specs and features in simplecov Jul 6, 2015
.travis.yml Remove unsupported rubies Apr 28, 2016
.yardopts Added a proper .yardopts file Apr 30, 2015
CONTRIBUTING.md Clarify the use of still branch in CONTRIBUTING-guide May 7, 2016
Dockerfile Run tests by default on docker run Apr 27, 2016
Gemfile Fix dependency on rubocop Aug 15, 2016
History.md Update history May 10, 2016
LICENSE Update year in license Jan 2, 2016
README.md Update README.md Jul 26, 2016
Rakefile Use aruba's own deprecated method May 7, 2016
TODO.md Added some more methods Mar 8, 2016
appveyor.yml Stop supporting Ruby 1.8.7 and Ruby 1.9.2 May 5, 2016
aruba.gemspec Update dependencies Apr 28, 2016
cucumber.yml Stop supporting Ruby 1.8.7 and Ruby 1.9.2 May 5, 2016
docker-compose.yml Fix command in docker-compose.yml Apr 28, 2016


Gem Version Dependency Status Code Climate Join the chat at https://gitter.im/cucumber/aruba

This is the latest version of our README.md. If you want to see the one of the last released version of "aruba", please have a look at this one.

aruba is an extension for popular TDD and BDD frameworks like "Cucumber", "RSpec" and "Minitest" to make testing of commandline applications meaningful, easy and fun.

Your benefits:

  • Test any command line application implemented in any programming language - e.g. Bash, Python, Ruby, Java, ...
  • Manipulate the file system and the process environment with helpers working similar like tools you may know from your shell
  • No worries about leaking state: The file system and the process environment will be reset between tests
  • Support by a helpful and welcoming community – see our Code of Conduct
  • The documentation is our contract with you. You can expect aruba to work as documented

Our Vision:

  • Help our users to build better command line applications written in any programming language
  • Make creating documentation for command line simple and fun
  • Support the cucumber community in its effort to create a specification for all official cucumber implementations

Our Focus:

  • Test the user-interaction with the commands at runtime – this excludes the process of installation/deployment of commands like installing Rubygems with gem install <your-gem>.

Build status
Version Linux / OS X Windows
master Build Status Build status
still Build Status Build status


Add this line to your application's Gemfile:

gem 'aruba'

And then execute:

$ bundle

Or install it yourself as:

$ gem install aruba

Release Policy

We try to be compliant to Semantic Versioning 2.0.0.

Supported ruby versions

For an up to date list of all supported ruby versions, please see our .travis.yml. We only test against the latest version of a version branch - most times.


Please also see this feature test for the most up to date documentation.

Initialize your project with "aruba"

There's an initializer to make it easier for you to getting started. If you prefer to setup aruba yourself, please move on to the next section.

  1. Go to your project's directory

  2. Make sure, it's under version control and all changes are committed to your version control repository

  3. Run one of the following commands depending on the tools you use to test your project.

    This assumes, that you use either rspec, cucumber-ruby or minitest to write the tests for your project. Besides that, your tool can be implemented in any programming language you like.

    aruba init --test-framework rspec
    aruba init --test-framework cucumber
    aruba init --test-framework minitest


  1. Create a file named "features/support/env.rb" with:

    require 'aruba/cucumber'
  2. Create a file named "features/use_aruba_with_cucumber.feature" with:

    Feature: Cucumber
     Scenario: First Run
       Given a file named "file.txt" with:
       Hello World
       Then the file "file.txt" should contain:
       Hello World
  3. Run cucumber


  1. Create a file named "spec/support/aruba.rb" with:

    require 'aruba/rspec'
  2. Create a file named "spec/spec_helper.rb" with:

    $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
    ::Dir.glob(::File.expand_path('../support/**/*.rb', __FILE__)).each { |f| require_relative f }
  3. Create a file named "spec/use_aruba_with_rspec_spec.rb" with:

    require 'spec_helper'
    RSpec.describe 'First Run', :type => :aruba do
     let(:file) { 'file.txt' }
     let(:content) { 'Hello World' }
     before(:each) { write_file file, content }
     it { expect(read(file)).to eq [content] }
  4. Run rspec


  1. Add a file named "test/support/aruba.rb" with:

    require 'aruba/api'
  2. Add a file named "test/test_helper.rb" with:

    $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
    ::Dir.glob(::File.expand_path('../support/**/*.rb', __FILE__)).each { |f| require_relative f }
  3. Add a file named "test/use_aruba_with_minitest.rb" with:

    $LOAD_PATH.unshift File.expand_path('../test', __FILE__)
    require 'test_helper'
    require 'minitest/autorun'
    class FirstRun < Minitest::Test
     include Aruba::Api
     def setup
     def getting_started_with_aruba
       file = 'file.txt'
       content = 'Hello World' 
       write_file file, content
       read(file).must_equal [content]
  4. Run your tests

    ruby -Ilib:test test/use_aruba_with_minitest.rb


User Documentation

If you're interested in our steps and API, please browse our feature files. You can find a lot of examples there. A good starting point are Getting Started and Step Overview. A more or less full list of our steps can be found here. Our API is documentated here and some more information about how to configure aruba, can be found here. The "RSpec" matchers provided by aruba, are documented here you can use them with any testing framework we support.

You can find our documentation on Relish as well. Unfortunately "Relish" does not like the way we structured our feature tests. So this documentation found there may be not complete.

Table of Contents

There are some things which are still undocumented. We would like to encourage you to add documentation for those and send us a PR.

Developer Documentation

aruba provides a wonderful API to be used in your tests:

  • Creating files/directories
  • Deleting files/directories
  • Checking file size
  • Checking file existence/absence
  • ...

A full documentation of the API can be found here.


Please see the CONTRIBUTING file.


Copyright (c) 2010-2016 Aslak Hellesøy et al. See MIT License for details.