<commit_before>cucumber-blinkbox-rest
======================

Standard cucumber step definitions and helpers for testing RESTful APIs

## HTTP library abstraction

Because it's beneficial to use a number of different HTTP libraries during our testing I've written a small script to capture the HTTP response information from each of the supported libraries so they can be examined after-the-fact. For example:

    require 'httpclient'
    # Include the relevant capture library
    require 'httpclient/capture'

    # Perform a request, as usual
    clnt = HTTPClient.new
    clnt.get_content("http://google.com") # => "<html>..."

    # Now you can retrieve all the captured responses:
    Net::CapturedHTTP.last.status # => 200
    Net::CapturedHTTP.last['Content-Length'] # => 12345
    Net::CapturedHTTP.last.body # => "<html>..."

The objects in the CapturedHTTP array contain the exact objects, wrapped by 
<commit_msg>Readme bits<commit_after>cucumber-blinkbox-rest
======================

Standard cucumber step definitions and helpers for testing RESTful APIs

## HTTP library abstraction

Because it's beneficial to use a number of different HTTP libraries during our testing I've written a small script to capture the HTTP response information from each of the supported libraries so they can be examined after-the-fact. For example:

    require 'httpclient'
    # Include the relevant capture library
    require 'httpclient/capture'

    # Perform a request, as usual
    clnt = HTTPClient.new
    clnt.get_content("http://google.com") # => "<html>..."

    # Now you can retrieve all the captured responses:
    Net::Captured::Responses.last.status # => 200
    Net::Captured::Responses.last['Content-Length'] # => 12345
    Net::Captured::Responses.last.body # => "<html>..."
    Net::Captured::Responses.last.response # => <HTTPClient::Response>

The objects in the Captured::Responses array contain the exact objects, wrapped by helper functions which expose three methods: `code` for the status code, `[](key)` for accessing headers and `body` for reading the body of the document.

{'fraction_non_alphanumeric': 0.11037107516650808, 'fraction_numerical': 0.007611798287345386, 'mean_word_length': 4.2575, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 17, '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': '4343405', 'n_tokens_mistral': 579, 'n_tokens_neox': 537, 'n_words': 221}