<commit_before># clicumber

[![Build Status](https://travis-ci.org/DannyBen/clicumber.svg?branch=master)](https://travis-ci.org/DannyBen/clicumber)

Cucumber step definitions for testing command line applications.


## Usage

Grab a copy of the [step definitions file][2] and place it in your 
`step_definitions` folder.

To see the available steps, look at the [showcase feature file][3] or at the
[step definitions summary][1].

If you do not have your cucumber environment set up already, you can also
execute `run scaffold` in the repository's folder. It will generate a 
`scaffold` folder for you with everything you need to get started.


## Features

- Steps for running any command and capturing its output, stderr and exit code
- Steps for querying folder status
- Steps for querying file status and contents
- Steps for creating file and folder fixtures
- Steps for querying the command's output, stderr and exit code


## Downloading the Step Definitions file programmatically

If you are using the [step definitions][2] file as is in your project 
(recommended), then you can add a rake task or shell script to fetch a fresh
copy of it on demand:

```
curl -o 'features/step_definitions/clicumber.rb' https://raw.githubusercontent.com/DannyBen/clicumber/master/features/step_definitions/clicumber.rb
```

If you are using [Runfile][4], you can use this task:

```
help   "Download a fresh copy of clicumber stepdefs"
action :clicumber do
  file = "features/step_definitions/clicumber.rb"
  url  = "https://raw.githubusercontent.com/DannyBen/clicumber/master/features/step_definitions/clicumber.rb"<commit_msg>readme: add syntax highlighting<commit_after># clicumber

[![Build Status](https://travis-ci.org/DannyBen/clicumber.svg?branch=master)](https://travis-ci.org/DannyBen/clicumber)

Cucumber step definitions for testing command line applications.


## Usage

Grab a copy of the [step definitions file][2] and place it in your 
`step_definitions` folder.

To see the available steps, look at the [showcase feature file][3] or at the
[step definitions summary][1].

If you do not have your cucumber environment set up already, you can also
execute `run scaffold` in the repository's folder. It will generate a 
`scaffold` folder for you with everything you need to get started.


## Features

- Steps for running any command and capturing its output, stderr and exit code
- Steps for querying folder status
- Steps for querying file status and contents
- Steps for creating file and folder fixtures
- Steps for querying the command's output, stderr and exit code


## Downloading the Step Definitions file programmatically

If you are using the [step definitions][2] file as is in your project 
(recommended), then you can add a rake task or shell script to fetch a fresh
copy of it on demand:

```
curl -o 'features/step_definitions/clicumber.rb' https://raw.githubusercontent.com/DannyBen/clicumber/master/features/step_definitions/clicumber.rb
```

If you are using [Runfile][4], you can use this task:

```ruby
help   "Download a fresh copy of clicumber stepdefs"
action :clicumber do
  file = "features/step_definitions/clicumber.rb"
  url  = "https://raw.githubusercontent.com/DannyBen/clicumber/master/features/step_definitions/clicumber.rb"
{'fraction_non_alphanumeric': 0.08302696078431372, 'fraction_numerical': 0.0030637254901960784, 'mean_word_length': 4.748239436619718, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6731510', 'n_tokens_mistral': 991, 'n_tokens_neox': 928, 'n_words': 387}