Project

cli_tester

0.0
No commit activity in last 3 years
No release in over 3 years
CliTester provides a set of RSpec helpers to test command line interfaces by running commands and checking output and exit codes.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

 Project Readme

Gem Version Build Status

CliTester is a simple set of helpers for testing command line interfaces with RSpec. It provides a method to run command line applications and a way to check the output and exit codes.

Use it in combination with GivenFilesystem for convenient testing of command line applications.

CliTester is licensed under the MIT license.

If you have questions or comments, please get in touch with Cornelius Schumacher schumacher@kde.org.

Usage

To make the helpers of cli_tester available in your tests add the cli_tester gem to your Gemfile and include the CliTester module in your tests, e.g. in your spec_helper.rb:

require "cli_tester"

include CliTester

Helpers

  • run_command: Run command with specified arguments
  • exits_with_success: Check that executable exits with exit code 0
  • exits_with_error: Check that executable exits with exit code different from 0