Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix includes matcher for Array values #302

Merged
merged 1 commit into from
Jun 18, 2017
Merged

Fix includes matcher for Array values #302

merged 1 commit into from
Jun 18, 2017

Conversation

timcraft
Copy link
Contributor

The following code works with mocha v1.1.0:

MyClass.any_instance.expects(:my_method).with(includes([1, 2]))

MyClass.new.some_method([[1, 2], [3, 4]])

It doesn't work in v1.2.0 due to commit ff8ce38,
which changes the existing behaviour for Array values.

This commit reverts to the previous behaviour (only one block argument),
and adds a special case for Hash to match against keys.

The following code works with mocha v1.1.0:

    MyClass.any_instance.expects(:my_method).with(includes([1, 2]))

    MyClass.new.some_method([[1, 2], [3, 4]])

It doesn't work in v1.2.0 due to commit ff8ce38,
which changes the existing behaviour for `Array` values.

This commit reverts to the previous behaviour (only one block argument),
and adds a special case for `Hash` to match against keys.
@floehopper floehopper self-assigned this Jun 18, 2017
@floehopper floehopper merged commit dd2d72c into freerange:master Jun 18, 2017
@floehopper
Copy link
Member

@timcraft: Thanks!

@blimmer
Copy link

blimmer commented Aug 22, 2017

Any chance of getting this in a 1.2.2 release?

@floehopper
Copy link
Member

@blimmer: Sorry. Yes, I'll try to get it deployed in the next day or two. Thanks for your patience.

@blimmer
Copy link

blimmer commented Aug 24, 2017

Awesome, thanks!

@floehopper
Copy link
Member

@blimmer
Copy link

blimmer commented Aug 24, 2017

Thanks a ton! 🥂

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

Successfully merging this pull request may close these issues.

None yet

3 participants