<commit_before># Testing

The built-in Faraday Test adapter lets define stubbed HTTP requests. This can
be used to mock out network services in an application's unit tests.

The easiest way to do this is to create the stubbed requests when initializing
a `Faraday::Connection`. Stubbing a request by path yields a block with a
`Faraday::Env` object. The stub block expects an Array return value with three
values: an Integer HTTP status code, a Hash of key/value headers, and a
response body.

```ruby
conn = Faraday.new do |builder|
  builder.adapter :test do |stub|
    stub.get('/ebi') do |env|
      [
        200, # status code
        {
          'Content-Type': 'text/plain',
        }, # headers
        'shrimp' # response body
      ]
    end
  end
end
```

You can define the stubbed requests outside of the test adapter block:

```ruby<commit_msg>[ci skip] Add missing "you"<commit_after># Testing

The built-in Faraday Test adapter lets you define stubbed HTTP requests. This can
be used to mock out network services in an application's unit tests.

The easiest way to do this is to create the stubbed requests when initializing
a `Faraday::Connection`. Stubbing a request by path yields a block with a
`Faraday::Env` object. The stub block expects an Array return value with three
values: an Integer HTTP status code, a Hash of key/value headers, and a
response body.

```ruby
conn = Faraday.new do |builder|
  builder.adapter :test do |stub|
    stub.get('/ebi') do |env|
      [
        200, # status code
        {
          'Content-Type': 'text/plain',
        }, # headers
        'shrimp' # response body
      ]
    end
  end
end
```

You can define the stubbed requests outside of the test adapter block:

```ruby
{'fraction_non_alphanumeric': 0.08064516129032258, 'fraction_numerical': 0.0034562211981566822, 'mean_word_length': 3.1161137440758293, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '5290587', 'n_tokens_mistral': 512, 'n_tokens_neox': 482, 'n_words': 236}