rspec-match_table
It is array of hashes matcher.
Installation
Add this line to your application's Gemfile:
gem 'rspec-match_table'
And then execute:
$ bundle
Or install it yourself as:
$ gem install rspec-match_table
Usage
require 'rspec/match_table'
RSpec.describe do
specify do
context 'when not match' do
specify do
expect(
[
{foo: 'bar', 100 => :zoo, '100' => 100},
{bar: 'foo', 200 => :baz, '200' => 200},
{baz: 'bar', 300 => 'foo', '300' => 300},
]
).to match_table(
[
{foo: 'bar', 100 => :zoo, '100' => 100},
{bar: 'foo', 200 => 'baz', '200' => 200},
{baz: 'bar', 300 => 'foo', '300' => 301},
]
)
end
end
end