-
Notifications
You must be signed in to change notification settings - Fork 313
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
Restrict pending the spec to only Ruby versions 2.2.0, 2.2.1, 2.2.2 #313
Restrict pending the spec to only Ruby versions 2.2.0, 2.2.1, 2.2.2 #313
Conversation
e822f48
to
3cc9955
Compare
# For things Broken in Ruby <= 2.2.2, Fixed in 2.2.3+ | ||
def pending_for_mri220_to_mri222 | ||
version = ruby_version | ||
return unless version.start_with?('ruby_2.2') && version.end_with?('0', '1', '2') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a finate list of these, can we just check for something like ['ruby_2.2....].include?
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep. Changing.
3cc9955
to
52476cb
Compare
if mri22? | ||
pending 'Bug in MRI 2.2.x means this behavior is broken in those versions' | ||
end | ||
pending_for(engine: 'ruby', versions: %w(2.2.0 2.2.1 2.2.2)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dblock How do you like me now. 😸
52476cb
to
e79659e
Compare
@dblock this is ready, and output, running specs on Ruby 2.2.2 looks like:
|
453101c
to
feb9472
Compare
- Better paradigm for pending specs due to bugs in interpreter
feb9472
to
a44dd9a
Compare
It's an amazing effort. However am I wrong that most of this is implemented in https://github.com/janlelis/ruby_version or https://github.com/martinkozak/ruby-version?
|
You're right about that, dB. I made the conscious decision not to pull in one of those back when I added the simple check. If we need the more complicated logic, it might make sense to pull one of them in. |
Well what's here is more complicated logic. This entire thing should be a 1-liner, but it should be robust, Hashie is not in the business of parsing ruby versions. Would you like to try with one of those gems? |
And sorry to be a pest ;) |
I'll switch to a maintained gem. My StrictKeyAccess / Dictionary PR has some specs that are pended for Rubinius, and utilized this complication. |
Thanks @pboling - hang in there! Lets get this PR done first. Add a note when you amended it. |
@dblock Having reviewed the options I propose we use:
Because they appear maintained, and the syntax is good. |
I don't care which gem personally as long as we have something like a 1-liner in hashie ;) |
@dblock I used those two gems, but the complexity remained in Hashie, so I rolled it out into a separate gem, as it seems like a common, generic, basic need of many projects, that I think I will want to use... everywhere. |
If this is acceptable, then I will rebase and squash commits. Let me know. |
👍 on |
…d-mash-spec Restrict pending the spec to only Ruby versions 2.2.0, 2.2.1, 2.2.2
Awesome, merged. |
## 3.4.3 (10/25/2015) * [#314](hashie/hashie#314): Added a `StrictKeyAccess` extension that will raise an error whenever a key is accessed that does not exist in the hash - [@pboling](https://github.com/pboling). * [#304](hashie/hashie#304): Ensured compatibility of `Hash` extensions with singleton objects - [@regexident](https://github.com/regexident). * [#306](hashie/hashie#306): Added `Hashie::Extensions::Dash::Coercion` - [@marshall-lee](https://github.com/marshall-lee). * [#310](hashie/hashie#310): Fixed `Hashie::Extensions::SafeAssignment` bug with private methods - [@marshall-lee](https://github.com/marshall-lee). * [#313](hashie/hashie#313): Restrict pending spec to only Ruby versions 2.2.0-2.2.2 - [@pboling](https://github.com/pboling). * [#315](hashie/hashie#315): Default `bin/` scripts: `console` and `setup` - [@pboling](https://github.com/pboling).
Fixes #312
ruby_version
andruby_engine
gems. Just using them directly did not actually reduce the complexity much.