Sha256: 12a31124a0967b0f91deb8193ae2fb031aba5dd04048b1ebff20a30a61dd198a
Contents?: true
Size: 1.18 KB
Versions: 1
Compression:
Stored size: 1.18 KB
Contents
# RSpec Deep Matcher [![Gem Version](https://badge.fury.io/rb/rspec-deep-ignore-order-matcher.svg)](https://badge.fury.io/rb/rspec-deep-ignore-order-matcher) [![Code Climate](https://codeclimate.com/github/amogil/rspec-deep-ignore-order-matcher/badges/gpa.svg)](https://codeclimate.com/github/amogil/rspec-deep-ignore-order-matcher) [![Build Status](https://travis-ci.org/amogil/rspec-deep-ignore-order-matcher.svg?branch=master)](https://travis-ci.org/amogil/rspec-deep-ignore-order-matcher) 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 ```
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
rspec-deep-ignore-order-matcher-0.0.6 | README.md |