<commit_before># A Real Pain in the RSpec

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

Run your RSpec tests and print out punny spec descriptions.

## Installation

Add this line to your application's Gemfile:

```ruby
gem "pain_in_the_rspec"
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install pain_in_the_rspec

## Example output

```
PainInTheRspec::Pundit
  #pun
    wild-use chase Girls Just Want to Have Puns
    he who generates is lost a pun
    Sgt. Pepper's only Hearts Club Band puns on the first non-filtered word
```

## Usage

Run your specs like this:

    $ rspec --format PainInTheRspec::Formatter spec/

To always run your specs with PainInTheRspec, add the following line to your
`.rspec` file:

    --format PainInTheRspec::Formatter

## Pitfalls

The formatter uses a web API to get rhymes. It will therefore make a web request
for each example in your suite.

If you're using WebMock, you'll need to allow external network requests to
`rhymebrain.com`, which this gem uses:

```ruby
# To only allow rhymebrain.com
WebMock.disable_net_connect!(allow: "rhymebrain.com")<commit_msg>Encourage people to use this library<commit_after># A Real Pain in the RSpec

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

Run your RSpec tests and print out punny spec descriptions.

## Example output

```
PainInTheRspec::Pundit
  #pun
    wild-use chase Girls Just Want to Have Puns
    he who generates is lost a pun
    Sgt. Pepper's only Hearts Club Band puns on the first non-filtered word
```

## Installation

Add this line to your application's Gemfile:

```ruby
gem "pain_in_the_rspec"
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install pain_in_the_rspec

## Usage

Run your specs like this:

    $ rspec --format PainInTheRspec::Formatter spec/

To always run your specs with PainInTheRspec, add the following line to your
`.rspec` file:

    --format PainInTheRspec::Formatter

## Pitfalls

The formatter uses a web API to get rhymes. It will therefore make a web request
for each example in your suite.

If you're using WebMock, you'll need to allow external network requests to
`rhymebrain.com`, which this gem uses:

```ruby
# To only allow rhymebrain.com
WebMock.disable_net_connect!(allow: "rhymebrain.com")
{'fraction_non_alphanumeric': 0.08512363194162952, 'fraction_numerical': 0.0, 'mean_word_length': 4.163179916317992, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2384599', 'n_tokens_mistral': 850, 'n_tokens_neox': 792, 'n_words': 298}