Skip to content
This repository has been archived by the owner on Nov 30, 2024. It is now read-only.

Drop Ruby < 2.3 support #1349

Merged
merged 26 commits into from
Dec 15, 2020
Merged

Drop Ruby < 2.3 support #1349

merged 26 commits into from
Dec 15, 2020

Conversation

pirj
Copy link
Member

@pirj pirj commented Nov 15, 2020

Better viewed ignoring indentation changes https://github.com/rspec/rspec-mocks/pull/1349/files?diff=split&w=1

Sibling PRs:

As per rspec/rspec#61 (comment)

  • Is this needed in spec_helper.rb
    config.extend RSpec::Support::RubyFeatures
    config.include RSpec::Support::RubyFeatures
  • RSpec::Support.require_rspec_support 'ruby_features'
  • Usage of RubyFeatures
  • clean predicate_functions
  • [-] check respond_to?
  • check method_defined?
  • check send (where we call private methods that later became public)
  • check if we require_rspec_support ruby_features where RubyFeatures are not used
  • check define_method where def would suffice
  • check 1.8, 1.9, 2.0, 2.1, jruby, 9.0, 9.1, mri
  • check eval
  • clean up if RUBY_VERSION < "2.3" || backed_up_method_owner[method_name.to_sym] == self
  • change old ruby induced rubocop settings, fix offences
  • [#] Private method error changes when method_missing is defined but should not jruby/jruby#1398 - only fixed in JRuby 9.2
  • Can work without this check? Gemfile|28| 4:if RUBY_VERSION <= '2.3.0' && !!(RbConfig::CONFIG['host_os'] =~ /cygwin|mswin|mingw|bccwin|wince|emx/)
  • skip "This intermittently fails on JRuby" if RUBY_PLATFORM == 'java'
  • remove handle_restoration_failures?
  • remove expect_output_warning_on_ruby_lt_2
  • check "jruby"
  • clean? return Object unless Object.ancestors.last == ::BasicObject
  • clean if defined?(BasicObject)

@pirj pirj self-assigned this Nov 15, 2020
Copy link
Member

@benoittgt benoittgt left a comment

Choose a reason for hiding this comment

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

Ouhaoo. So happy with those changes. I have few questions.

lib/rspec/mocks/method_double.rb Outdated Show resolved Hide resolved
lib/rspec/mocks/syntax.rb Outdated Show resolved Hide resolved
script/functions.sh Outdated Show resolved Hide resolved
rspec-mocks.gemspec Show resolved Hide resolved
script/functions.sh Outdated Show resolved Hide resolved
.travis.yml Outdated Show resolved Hide resolved
lib/rspec/mocks/message_expectation.rb Show resolved Hide resolved
Gemfile-custom.sample Outdated Show resolved Hide resolved
lib/rspec/mocks/any_instance/recorder.rb Outdated Show resolved Hide resolved
lib/rspec/mocks/proxy.rb Outdated Show resolved Hide resolved
@pirj pirj force-pushed the drop-old-rubies branch 7 times, most recently from 5a84331 to 7e76f8e Compare November 15, 2020 23:51
@pirj pirj changed the title Drop old rubies Drop Ruby < 2.3 Nov 16, 2020
@pirj pirj force-pushed the drop-old-rubies branch 4 times, most recently from 2212a26 to 90a7f02 Compare November 18, 2020 15:22
@pirj pirj changed the title Drop Ruby < 2.3 [Quite far from being ready, please don't review just yet] Drop Ruby < 2.3 Nov 21, 2020
@pirj pirj force-pushed the drop-old-rubies branch 2 times, most recently from 1c13c7b to 32d7094 Compare November 22, 2020 21:43
@pirj pirj changed the title [Quite far from being ready, please don't review just yet] Drop Ruby < 2.3 [Please don't review just yet] Drop Ruby < 2.3 Nov 23, 2020
@pirj pirj changed the title [Please don't review just yet] Drop Ruby < 2.3 Drop Ruby < 2.3 Dec 8, 2020
maintenance-branch Outdated Show resolved Hide resolved
@pirj

This comment has been minimized.

@pirj
Copy link
Member Author

pirj commented Dec 14, 2020

Update: reverted the removal of rescue NameError from lib/rspec/mocks/method_double.rb.

@pirj pirj requested a review from JonRowe December 14, 2020 16:55
@pirj
Copy link
Member Author

pirj commented Dec 14, 2020

I'm combining ReentrantMutex and Mutex in rspec-support, so going to change those two require statements:

rspec-mocks/lib/rspec/mocks/message_expectation.rb:RSpec::Support.require_rspec_support 'mutex'
rspec-mocks/lib/rspec/mocks/proxy.rb:RSpec::Support.require_rspec_support "mutex"

Co-authored-by: Jon Rowe <hello@jonrowe.co.uk>
@JonRowe JonRowe merged commit 9fbf115 into 4-0-dev Dec 15, 2020
@pirj pirj deleted the drop-old-rubies branch December 15, 2020 08:36
@pirj pirj mentioned this pull request Nov 27, 2024
53 tasks
@pirj pirj added this to the RSpec 4 milestone Dec 25, 2020
yujinakayama pushed a commit to yujinakayama/rspec-monorepo that referenced this pull request Oct 19, 2021
…-rubies

Drop Ruby < 2.3 support

---
This commit was imported from rspec/rspec-mocks@9fbf115.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants