-
Notifications
You must be signed in to change notification settings - Fork 371
Test more recent versions of Ruby on Travis #480
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
Conversation
Added: - 2.4.9 (reached end-of-life but may temporarily help in incremental debugging) - 2.5.8 - 2.6.6 Did not add 2.7.x yet because it introduces *a lot* of warnings. Did not remove any past version yet because until decided otherwise, they should be supported by the gem. (I would recommend a major version bump when those versions get dropped.) The idea is that developments from now on should be future-proof, and changes should be tested on current versions of Ruby.
Updating to WebMock 2.x means that: > require 'webmock' does not enable WebMock anymore. gem 'webmock' can now be safely added to a Gemfile and no http client libs will be modified when it's loaded. Call WebMock.enable! to enable WebMock. > > Please note that require 'webmock/rspec', require 'webmock/test_unit', require 'webmock/minitest' and require 'webmock/cucumber' still do enable WebMock. Source: [WebMock's CHANGELOG.md](https://github.com/bblimke/webmock/blob/master/CHANGELOG.md#200). As rspec_api_documentation is very much tied to RSpec, I saw no problem with replacing all instances of `require 'webmock'` with `require 'webmock/rspec'`.
aa15612
to
2957b3f
Compare
An additional note on WebMock. I updated it to the latest 2.x because Ruby 2.4 support was introduced in 2.3.1, but 3.x versions of WebMock introduce more changes that will require more adjustments on rspec_api_documentation's side. Updating to WebMock 2.x means that:
As rspec_api_documentation is very much tied to RSpec, I saw no problem with replacing all instances of |
Agreed on approach to adding modern ruby support, and needing a major release in order to drop old rubies.
|
Thanks for the feedback! Now have to get in to work with Ruby 2.6... 👀 (Hmm, Ruby 2.6 support was added to WebMock in its version 3.5.0... This is neverending! 😅 ) |
3.2.0 introduced another breaking change that had to be addressed: [Automatically disable WebMock after rspec suite](bblimke/webmock#731) As the example app_spec.rb in features/oauth2_mac_client.feature is supposed to be a stand-alone spec file, it made sense, to me, to `require "webmock/rspec"`. Does that make any sense?
This introduces Ruby 2.6 support and should get the test suite to run on that version of Ruby.
Notes:
|
Let's see how this goes on Travis.
Ready to go. |
🙏 |
* Test more recent versions of Ruby on Travis Added: - 2.4.9 (reached end-of-life but may temporarily help in incremental debugging) - 2.5.8 - 2.6.6 Did not add 2.7.x yet because it introduces *a lot* of warnings. Did not remove any past version yet because until decided otherwise, they should be supported by the gem. (I would recommend a major version bump when those versions get dropped.) The idea is that developments from now on should be future-proof, and changes should be tested on current versions of Ruby. * Update WebMock to latest 2.x version Updating to WebMock 2.x means that: > require 'webmock' does not enable WebMock anymore. gem 'webmock' can now be safely added to a Gemfile and no http client libs will be modified when it's loaded. Call WebMock.enable! to enable WebMock. > > Please note that require 'webmock/rspec', require 'webmock/test_unit', require 'webmock/minitest' and require 'webmock/cucumber' still do enable WebMock. Source: [WebMock's CHANGELOG.md](https://github.com/bblimke/webmock/blob/master/CHANGELOG.md#200). As rspec_api_documentation is very much tied to RSpec, I saw no problem with replacing all instances of `require 'webmock'` with `require 'webmock/rspec'`. * Update WebMock dependency to 3.2.0 3.2.0 introduced another breaking change that had to be addressed: [Automatically disable WebMock after rspec suite](bblimke/webmock#731) As the example app_spec.rb in features/oauth2_mac_client.feature is supposed to be a stand-alone spec file, it made sense, to me, to `require "webmock/rspec"`. Does that make any sense? * Bump WebMock dev dependency to 3.5.0 This introduces Ruby 2.6 support and should get the test suite to run on that version of Ruby. * Try using WebMock 3.8.3 Let's see how this goes on Travis.
Added:
Did not add 2.7.x yet because it introduces a lot of warnings.
Did not remove any past version yet because until decided otherwise, they should be supported by the gem. (I would recommend a major version bump when those versions get dropped.)
The idea is that developments from now on should be future-proof, and changes should be tested on current versions of Ruby.
Note I had to relax WebMock's version because it introduced support for Ruby 2.4 in its version 2.3.1.
This does not work yet. There is one spec that used to pass with the older version of WebMock (in older versions of Ruby), but that does not pas anymore.
My guess is that it relied on some implementation detail of the WebMock gem, so I am working on finding out how to fix this.
(Additional note: I just noticed Cucumber runs only if RSpec succeeds. Running Cucumber locally, I noticed 4 scenarios fail, also potentially due to changes in WebMock.)