Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cornelius/cli_tester
RSpec helpers for testing command line interfaces
https://github.com/cornelius/cli_tester
rspec
Last synced: 4 months ago
JSON representation
RSpec helpers for testing command line interfaces
- Host: GitHub
- URL: https://github.com/cornelius/cli_tester
- Owner: cornelius
- License: mit
- Created: 2015-06-14T20:24:52.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-02-12T22:00:12.000Z (almost 8 years ago)
- Last Synced: 2024-04-25T12:20:21.342Z (10 months ago)
- Topics: rspec
- Language: Ruby
- Size: 15.6 KB
- Stars: 3
- Watchers: 4
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: MIT-LICENSE
Awesome Lists containing this project
README
[![Gem Version](https://badge.fury.io/rb/cli_tester.svg)](http://badge.fury.io/rb/cli_tester)
[![Build Status](https://travis-ci.org/cornelius/cli_tester.svg?branch=master)](https://travis-ci.org/cornelius/cli_tester)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](https://github.com/cornelius/given_filesystem) 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
.## 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`:
```ruby
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