sajad torkamani

What is Aruba?

Aruba is a testing framework that helps you test your command-line applications.

It can help you to:

  • Test CLI apps written in any programming language.
  • Manipulate the file system and process environment.
  • Run your tests inside a sandbox that’s reset between each test.

By default, Aruba runs your commands in a separate child process.

Install

See docs.

Recipes

Default home directory

<project-path>/tmp/aruba

This is set here.

Run command

run_command 'foo'

Create file

write_file 'file.txt', 'Hello Aruba!'

Assert stderr contains substring

expect(last_command_started).to have_output_on_stderr 'blah'

Assert exit code

expect(last_command_stopped).to have_exit_status 1

Sources

Leave a comment

Your email address will not be published. Required fields are marked *