Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Make the `include` matcher require keys to be present in a target hash #175

Closed
wants to merge 2 commits into
from

Conversation

Projects
None yet
2 participants
Owner

samphippen commented Sep 27, 2012

This is related to #174.

Myron suggested we make specs like this

{}.should include('some_key' => nil)

fail instead of succeeding. This patch does that.

samphippen added some commits Sep 27, 2012

Make the include matcher require the key to exist in the hash.
There was a weird case where {}.should include(:something => nil) would
pass, Myron suggested we make this not the case. Here's a patch that
does that

Signed-off-by: Sam Phippen <samphippen@googlemail.com>
Add a spec for the new include behaviour only matching existing keys
Signed-off-by: Sam Phippen <samphippen@googlemail.com>
Owner

myronmarston commented Sep 27, 2012

Thanks, Sam! I squashed your commits together and pushed it as 04eb38d.

In the future, please include the code change and the spec in the same commit.

Owner

samphippen commented Sep 27, 2012

On 27 Sep 2012, at 15:46, Myron Marston wrote:

Thanks, Sam! I squashed your commits together and pushed it as 04eb38d.

In the future, please include the code change and the spec in the same commit.

Ok Sure.


Reply to this email directly or view it on GitHub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment