No commit activity in last 3 years
No release in over 3 years
This gem adds a custom matcher to RSpec to recursively compare nested Ruby data-structures consisting of `Hash` and `Array` elements. An order of elements in an array is ignored.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

~> 2.2
~> 13.0
~> 1.12

Runtime

~> 3.10
 Project Readme

RSpec Deep Matcher

Gem Version Code Climate Build Status

This gem adds a custom matcher to RSpec to recursively compare nested Ruby data-structures consisting of Hash and Array elements. An order of elements in an array is ignored.

Install

gem install rspec-deep-ignore-order-matcher

or add to your Gemfile

gem 'rspec-deep-ignore-order-matcher'

and run

bundle install

Example

require 'rspec-deep-ignore-order-matcher'

describe 'Products' do
	it "should ignore order of product's tags" do
		expected = [{ :product => { :title => 'Product 1', :tags => ['large', 'blue', 'heavy'] } }]
		actual = [{ :product => { :title => 'Product 1', :tags => ['blue', 'large', 'heavy'] } }]
		expect(actual).to be_deep_equal expected
	end
end