<commit_before># Minitest::Filesystem

Adds assertions and expectations to check filesystems content in a readable way.

## Installation

Add this line to your application's Gemfile:

    gem 'minitest-filesystem'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install minitest-filesystem

Once the gem is installed, just add this line to your `test_helper.rb`:

```ruby
require 'minitest/filesystem'
```

## Usage

Let's suppose the following filesystem structure exists:

* `root_dir/`
  * `file_1`
  * `file_2`
  * `subdir_1/`
      * `subfile_1`
      * `subfile_2`
      * `subsubdir_1/`
  * `subdir_2/`

You can check if `root_dir` contains a specific structure:

```ruby
assert_contains_filesystem("root_dir") do
  file "file_1"
  dir "subdir_1" do
    file "subfile_1"
  end
  dir "subdir_2"
end
```

or, if you prefer the expectation style:

```ruby
filesystem {
  file "file_1"
  dir "subdir_1" do
    file "subfile_1"
  end
  dir "subdir_2"
}.must_exist_within "root_dir"
```

Note that the match **need not to be exact** (i.e. there can be other files and
directories inside `root_dir` that we don't care about).
<commit_msg>Add badges.<commit_after># Minitest::Filesystem

[![Gem Version](https://badge.fury.io/rb/minitest-filesystem.png)](http://badge.fury.io/rb/minitest-filesystem)
[![Build Status](https://travis-ci.org/stefanozanella/minitest-filesystem.png?branch=master)](https://travis-ci.org/stefanozanella/minitest-filesystem)
[![Code Climate](https://codeclimate.com/github/stefanozanella/minitest-filesystem.png)](https://codeclimate.com/github/stefanozanella/minitest-filesystem)
[![Coverage Status](https://coveralls.io/repos/stefanozanella/minitest-filesystem/badge.png?branch=master)](https://coveralls.io/r/stefanozanella/minitest-filesystem?branch=master)

Adds assertions and expectations to check filesystems content in a readable way.

## Installation

Add this line to your application's Gemfile:

    gem 'minitest-filesystem'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install minitest-filesystem

Once the gem is installed, just add this line to your `test_helper.rb`:

```ruby
require 'minitest/filesystem'
```

## Usage

Let's suppose the following filesystem structure exists:

* `root_dir/`
  * `file_1`
  * `file_2`
  * `subdir_1/`
      * `subfile_1`
      * `subfile_2`
      * `subsubdir_1/`
  * `subdir_2/`

You can check if `root_dir` contains a specific structure:

```ruby
assert_contains_filesystem("root_dir") do
  file "file_1"
  dir "subdir_1" do
    file "subfile_1"
  end
  dir "subdir_2"
end
```

or, if you prefer the expectation style:

```ruby
filesystem {
  file "file_1"
  dir "subdir_1" do
    file "subfile_1"
  end
  dir "subdir_2"
}.must_exist_within "root_dir"
```

Note that the match **need not to be exact** (i.e. there can be other files and
directories inside `root_dir` that the matcher won't care about).

{'fraction_non_alphanumeric': 0.11933174224343675, 'fraction_numerical': 0.010228435049437436, 'mean_word_length': 4.220640569395018, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 7, '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': '1578623', 'n_tokens_mistral': 1092, 'n_tokens_neox': 1036, 'n_words': 280}