Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/amogil/rspec-deep-ignore-order-matcher
RSpec Deep Matcher
https://github.com/amogil/rspec-deep-ignore-order-matcher
rspec rspec-deep-matcher rspec-matchers ruby
Last synced: 8 days ago
JSON representation
RSpec Deep Matcher
- Host: GitHub
- URL: https://github.com/amogil/rspec-deep-ignore-order-matcher
- Owner: amogil
- License: mit
- Created: 2013-03-18T05:22:35.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2021-04-09T11:49:25.000Z (over 3 years ago)
- Last Synced: 2024-10-31T09:41:48.364Z (15 days ago)
- Topics: rspec, rspec-deep-matcher, rspec-matchers, ruby
- Language: Ruby
- Homepage:
- Size: 24.4 KB
- Stars: 5
- Watchers: 4
- Forks: 10
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# 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
```