<commit_before># RspecMatcherHashItem

[![Build Status](https://travis-ci.org/jantman/rspec-matcher-hash-item.svg?branch=master)](https://travis-ci.org/jantman/rspec-matcher-hash-item)
[![Code Coverage](https://codecov.io/github/jantman/rspec-matcher-hash-item/coverage.svg?branch=master)](https://codecov.io/github/jantman/rspec-matcher-hash-item?branch=master)
[![Code Climate](https://codeclimate.com/github/jantman/rspec-matcher-hash-item/badges/gpa.svg)](https://codeclimate.com/github/jantman/rspec-matcher-hash-item)
[![Gem Version](https://img.shields.io/gem/v/rspec-matcher-hash-item.svg)](https://rubygems.org/gems/rspec-matcher-hash-item)
[![Total Downloads](https://img.shields.io/gem/dt/rspec-matcher-hash-item.svg)](https://rubygems.org/gems/rspec-matcher-hash-item)
[![Github Issues](https://img.shields.io/github/issues/jantman/rspec-matcher-hash-item.svg)](https://github.com/jantman/rspec-matcher-hash-item/issues)
[![Project Status: Active - The project has reached a stable, usable state and is being actively developed.](http://www.repostatus.org/badges/0.1.0/active.svg)](http://www.repostatus.org/#active)

This gem provides some rspec matchers to simplify assertions about
the internal state of has hobjects.

## Installation

Add this line to your application's Gemfile:

    gem 'rspec-matcher-hash-item'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install rspec-matcher-hash-item

## Usage

In your spec_helper, add a line like:

    require 'rspec_matcher_hash_item'

### Matchers

#### have_hash_item_matching<commit_msg>note able composable matchers<commit_after># RspecMatcherHashItem

[![Build Status](https://travis-ci.org/jantman/rspec-matcher-hash-item.svg?branch=master)](https://travis-ci.org/jantman/rspec-matcher-hash-item)
[![Code Coverage](https://codecov.io/github/jantman/rspec-matcher-hash-item/coverage.svg?branch=master)](https://codecov.io/github/jantman/rspec-matcher-hash-item?branch=master)
[![Code Climate](https://codeclimate.com/github/jantman/rspec-matcher-hash-item/badges/gpa.svg)](https://codeclimate.com/github/jantman/rspec-matcher-hash-item)
[![Gem Version](https://img.shields.io/gem/v/rspec-matcher-hash-item.svg)](https://rubygems.org/gems/rspec-matcher-hash-item)
[![Total Downloads](https://img.shields.io/gem/dt/rspec-matcher-hash-item.svg)](https://rubygems.org/gems/rspec-matcher-hash-item)
[![Github Issues](https://img.shields.io/github/issues/jantman/rspec-matcher-hash-item.svg)](https://github.com/jantman/rspec-matcher-hash-item/issues)
[![Project Status: Active - The project has reached a stable, usable state and is being actively developed.](http://www.repostatus.org/badges/0.1.0/active.svg)](http://www.repostatus.org/#active)

This gem provides some rspec matchers to simplify assertions about
the internal state of has hobjects.

Note that, as [@myronmarston](https://twitter.com/myronmarston) pointed out in a
[comment on my blog](http://blog.jasonantman.com/2015/02/rspec-matcher-for-hash-item-value/#comment-1868422853),
what ``have_hash_item_matching`` does is probably better and easier to do in rspec3 with composable matchers, like:

~~~~{.ruby}
its(:headers) { should include('keyname' => /match_regex/) }
~~~~

## Installation

Add this line to your application's Gemfile:

    gem 'rspec-matcher-hash-item'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install rspec-matcher-hash-item

## Usage

In your spec_helper, add a line like:

    require 'rspec_matcher_hash_item'

### Matchers

#### have_hash_item_matching
{'fraction_non_alphanumeric': 0.16114542391914655, 'fraction_numerical': 0.006457046603032005, 'mean_word_length': 5.121993127147766, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 25, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4748866', 'n_tokens_mistral': 1304, 'n_tokens_neox': 1244, 'n_words': 195}