Skip to content

Commit

Permalink
Remove custom have_attributes matcher
Browse files Browse the repository at this point in the history
This removes our custom have_attributes matcher which overrides RSpec's
default one. Ours added some functionality that doesn't need to exist
and can be done with other matchers like `include`.

Basically:

* Use `expect(thing).to include()` for collections, like hashes (most
common offense we use this custom one for).
https://relishapp.com/rspec/rspec-expectations/v/3-7/docs/built-in-matchers/include-matcher

* Use `expect(thing).to have_attributes()` for other objects that
actually have methods for the things you're checking. Models, for example.
https://relishapp.com/rspec/rspec-expectations/docs/built-in-matchers/have-attributes-matcher
  • Loading branch information
chrisarcand committed Feb 19, 2018
1 parent fb9e78a commit b3518a8
Showing 1 changed file with 0 additions and 59 deletions.
59 changes: 0 additions & 59 deletions spec/support/custom_matchers/have_attributes.rb

This file was deleted.

0 comments on commit b3518a8

Please sign in to comment.