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 keyword arguments and stream specs #199

Merged
merged 1 commit into from
Nov 26, 2020
Merged

Fix keyword arguments and stream specs #199

merged 1 commit into from
Nov 26, 2020

Conversation

ghost
Copy link

@ghost ghost commented Nov 20, 2020

Ruby 3.0 handles keyword arguments differently: https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/

This attempts to fix that issue. Note there are still two warnings that I'm not sure how to fix in redis_multiplexer.rb method_missing.

@sds sds merged commit 5393610 into sds:master Nov 26, 2020
@sds
Copy link
Owner

sds commented Nov 26, 2020

Thank you!

@pyromaniac
Copy link
Contributor

This patch seem to be causing issues in ruby 2.6 I believe you had to add ruby2_keywords gem to the list of dependencies as well, otherwise it doesn't get loaded before mock_redis

@ghost
Copy link
Author

ghost commented Jan 6, 2021

@pyromaniac I did update the Gemfile: https://github.com/sds/mock_redis/blob/master/Gemfile#L12

Hmm but not the gemspec: https://github.com/sds/mock_redis/blob/master/mock_redis.gemspec.#199. I think we need this in the gemspec:

s.add_runtime_dependency 'ruby2_keywords'

@pyromaniac
Copy link
Contributor

pyromaniac commented Jan 6, 2021

Yeah, that's what I meant, sorry :)

@ghost
Copy link
Author

ghost commented Jan 6, 2021

@sds can you add s.add_runtime_dependency 'ruby2_keywords' to the gemspec?

@pyromaniac
Copy link
Contributor

Oh well, thanks for releasing it with the runtime dep but apparently this is not enough, it still fails. I believe this is because you also need to require 'ruby2_keywords' in the code where it is used. Right now it is required in spec_helper, that's why specs are passing and the actually code doesn't work.

Comment on lines +17 to 19
id = @redises.xadd(@key, key: 'value')
expect(@redises.xadd(@key, key: 'value')).to match(/#{t}\d{3}-0/)
end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jasonatball This doesn't cause spec failures for you? Inserting the extra xadd call causes the subsequent xadd to return .........-1 rather than .........-0 for me.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was maybe lucky that my machine is slow? I can see how that could happen. I'm not sure why that line got there actually. I recently did another PR and ran all the tests successfully. Probably should either delete that line or change to expect(id).

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.

4 participants