<commit_before># RSpec Approvals

Approvals are based on the idea of the 'golden master'.

You take a snapshot of an approved object, and then compare all future
versions of the object to that approved version.

See [ApprovalTests](http://www.approvaltests.com) for videos and additional documentation about the general concept.

The original Approvals libraries for Java and C# were developed by <NAME>.


## Configuration

The default location for the output files is

    spec/approvals

You can change this using the configuration option

    RSpec.configure do |c|
      c.approvals_path = 'some/other/path'
    end


## Usage

The basic format of the approval is modeled after the RSpec example:

    approve "something" do
      "this is the received contents"
    end


The first time the specs are run, two files will be created:

    something.received.txt
    something.approved.txt


Since you have not yet approved anything, the something.approved.txt file is
empty.

The contents of the two files are compared.

Naturally, the approval will fail at this point.

If the contents of the received file is to your liking, you can approve
the file by overwriting the approved file with the received file.

    mv something.received.txt something.approved.txt

When you rerun the spec, it should now pass.<commit_msg>tweaking README<commit_after># RSpec Approvals

Approvals are based on the idea of the 'golden master'.

You take a snapshot of an approved object, and then compare all future
versions of the object to that approved version.

See [ApprovalTests](http://www.approvaltests.com) for videos and additional documentation about the general concept.

The original Approvals libraries for Java and C# were developed by <NAME>.


## Configuration

The default location for the output files is

    spec/approvals

You can change this using the configuration option

    RSpec.configure do |c|
      c.approvals_path = 'some/other/path'
    end


## Usage

The basic format of the approval is modeled after RSpec's _it_:

    approve "something" do
      "this is the received contents"
    end


The first time the specs are run, two files will be created:

    something.received.txt
    something.approved.txt


Since you have not yet approved anything, the something.approved.txt file is
empty.

The contents of the two files are compared, and naturally, the approval will fail at this point.

If the contents of the received file is to your liking, you can approve
the file by overwriting the approved file with the received file.

    mv something.received.txt something.approved.txt

When you rerun the spec, it should now pass.
{'fraction_non_alphanumeric': 0.047924528301886794, 'fraction_numerical': 0.0, 'mean_word_length': 3.7339285714285713, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '5052542', 'n_tokens_mistral': 720, 'n_tokens_neox': 668, 'n_words': 364}