-
Notifications
You must be signed in to change notification settings - Fork 29
Description
It's been in the air and mostly in sparse @JonRowe's comments (1, 2). This is an attempt to gather the ideas and start the discussion.
pre-4.0:
- fix internal deprecation matchers Internal affairs:
expect_warn_deprecation
matches any message when there'sfail
in the example rspec-support#451 - add deprecations for what we end up removing in 4.0
-
should
(monkey and non-monkey), syntax config options
-
- globally-exposed DSL, and its config option
-
shared_context_metadata_behavior
(discussion in Reconsidershared_context_metadata_behavior
rspec-core#2832)
-
run_all_when_everything_filtered
-
- ... a couple others
-
should
Mocks syntax
-
allow_message_expectations_on_nil
example method
-
- operator matching (
is_expected.to be
is a replacement forshould
, not justis_expected.to
)
- operator matching (
-
- legacy matcher support
-
include_chain_clauses_in_custom_matcher_descriptions
-
- present tense predicates
-
[ ] ?AnyInstance
-
[ ] ? DRb
4.0.0:
- Drop support for
EOLRuby versions 1.8.7 - 2.2 (Drop Ruby < 2.3 support rspec-core#2787 Drop Ruby < 2.3 support rspec-support#436 Drop Ruby < 2.3 support rspec-mocks#1349 Drop Ruby < 2.3 support rspec-expectations#1231) - remove monkey-patching (globally exposed DSL and
.should
) (Scrape out monkey patching rspec-core#2803 et al., all interlinked) - Remove deprecated features
-
- implicit block expectation syntax (Restrict block matchers use with value expectations rspec-expectations#1285)
-
-
run_all_when_everything_filtered
(Removerun_all_when_everything_filtered
configuration option rspec-core#2845)
-
-
-
shared_context_metadata_behavior
(Remove shared_context_metadata_behavior config option and make apply_to_host_groups the default rspec-core#2834)
-
-
-
include_chain_clauses_in_custom_matcher_descriptions
(Removeinclude_chain_clauses_in_custom_matcher_descriptions
option rspec-expectations#1279)
-
-
- legacy matcher support (Remove support for legacy RSpec matchers (pre 3) rspec-expectations#1253)
-
- raise where we previously warned (Raise instead of warn on long-deprecated usages rspec-core#2849)
-
- present-tense dynamic predicates (Remove support for present tense predicates rspec-expectations#1286)
-
- Remove deprecated
:example_group
example metadata sub-hash (Remove deprecated:example_group
example metadata sub-hash rspec-core#2851)
- Remove deprecated
-
- Remove deprecated Hash-like behavior from example execution result (Remove deprecated Hash-like behavior from example execution result rspec-core#2862)
-
- Various Core deprecations (Remove deprecations rspec-core#2864)
-
- Remove deprecated
allow_message_expectations_on_nil
example method (Remove deprecatedallow_message_expectations_on_nil
example method rspec-mocks#1410)
- Remove deprecated
-
- Remove
match_regex
matcher andStartAndEndWith
matcher base class from Expectations (Remove a couple of remaining deprecations rspec-expectations#1288)
- Remove
-
[ ] Removecurrently_executing_a_context_hook?
(Remove deprecatedcurrently_executing_a_context_hook?
rspec-core#2911)
- set new defaults
-
-
strict_predicate_matchers
(Turn strict_predicate_matchers on by default rspec-expectations#1277)
-
-
-
verify_partial_doubles = true
(Verify partial doubles by default rspec-mocks#1409)
-
[ ] Remove DRb runner (Remove DRb client runner rspec-core#2866)- extensively test (our current projects, repos from https://github.com/pirj/real-world-rspec)
- unify multi-condition filtering (ticket Unify multiple-condition filtering rspec-core#1821)
- add a warning when doc string is not a string (Add a warning when doc string is not a string rspec-core#2922)
- restrict passing a block to
include_examples
/include_context
(Raise on include_examples/context with a block #259) - remove deprecated
warn_about_potential_false_positives
([rspec-expectations] Remove deprecated warn_about_potential_false_positives #260, Updates for on potential false positives #199 ) - Raise on
include_examples
/include_context
with a block Raise on include_examples/context with a block #259 - Raise when docstring's are not a string (or
nil
) Raise ArgumentError when docstring's are not a string (or nil) #252 - Change
config.warnings=
to accept:all
/:deprecations_only
/:none
for Ruby warnings Set:all
/:deprecation_only
/:none
as options forconfig.warnings=
#161
post-4.0
- update RubyGems [new gem generator [1, 2]
- update
rspec-rails
/rspec-collection_matchers
/rspec-its
to support RSpec 4 - extract monkey-patching
.should
to a gem - kwargs delegation
- [?] update transpec to facilitate migration from 3.x to 4.x (
describe
- >RSpec.describe
?) - Cleanup: CI scripts
-
--no-document
forgem
-
unindent
/dedent
-><<~
- rearrange gemfile/gemspec (runtime dependencies to gemspec, development - to gemfiles)
- figure out why
rubocop
passes while there are offences inlib
(core, probably others too) - set
TargetRubyVersion
for RuboCop, and bump to latest (that supports parsing 2.4, which even the edge should) - tighten and improve
minimum_coverage
- update rake, cucumber, aruba to latest versions (cucumber to 4.1 because 5.x depends on Ruby 2.5+, or even 3.x because of
diff-lcs
)
Ruby support
TL;DR since time has passed, we decided to drop Ruby 2.x support altogether in RSpec 4
------ Outdated 2021 research below
EOL Ruby means we support 2.5+, since 2.4 is EOL in April 2020
However, according to 2020 RoR community survey
70% use 2.5+
81% use 2.4+
89% use 2.3+
Do 2.3 and 2.4 cause any trouble? I could only find this:
# 2.4 has improved BigDecimal formatting so we do not need
# to provide our own.
# https://github.com/ruby/bigdecimal/pull/42
classes.delete(BigDecimalInspector) if RUBY_VERSION >= '2.4'
I can only think of RuboCop's TargetRubyVersion
setting that has a minimum of 2.4. That means we won't be able to run rubocop
on 2.3 CI build.
Remove deprecated features/Introduce new defaults
-
shared_context_metadata_behavior
- monkey-patching mode
-
should
syntax (with implicit receiver only, whereshould
can be backed byis_expected.to
. extract to a gem?) - implicit block syntax (deprecated in Print deprecation message when implicit block expectation syntax is used rspec-expectations#1139)
Consider deprecating long-hanging/obscure features
[ ] DRb runner. I only know of Spork that was using it, but its 2.0.0-rc is years old now with no signs of life
Cleanup
-
rspec-core
: "Ruby 1.9 has a bug that can lead to infinite recursion and a"
Drafted in commits: ce2f4a0b 123e6ee7
Drop Ruby < 2.3 support rspec-core#2787 (review)RSpec::Matchers.define(:be_one) do match { |actual| actual == 1 } end RSpec.describe do alias_method :b, :be_one it { expect(1).to be_one } end
-
for all repos
- bump cucumber to
~> 5.2.0
, cucumber-ruby (undefined methodwith_filtered_backtrace') + fix deprec
titleto
name`- 1.3-2.0 don't work for me locally with a weird error: undefined method
[]' for nil:NilClass (NoMethodError) /Users/pirj/.rvm/gems/ruby-2.7.1@rspec-core/gems/cucumber-1.3.20/lib/cucumber/core_ext/proc.rb:17:in
file_colon_line' - 2.4.0 spits "undefined method `with_filtered_backtrace'"
- 3.2.0 - "undefined method 'ok?'"
- 4.1 depends on
diff-lcs (< 1.4, >= 1.3, ~> 1.3)
, while we depend on= 1.4.4
- 5.2.0
Found tags option '~@wip'. '~@tag' is no longer supported, use 'not @tag' instead
- 1.3-2.0 don't work for me locally with a weird error: undefined method
- update diff-lcs ">= 1.4.4" (Stop using DiffHelpers rspec-support#477 and co)
- update rake to latest
- skip documentation
yes | gem update --system --no-document
yes | gem install bundler --no-document
also on sub-builds? - rearrange Gemfile/gemspec
e.g. core: simplecov, test-unit, aruba, rake
To my best knowledge, add_development_dependency only affects local bundling. I've moved it over from the Gemfile.
As far as I understand we can shuffle those dependencies between add_development_dependency and Gemfile without affecting anything.
To me, it's better to keep those gems that we directly depend on here, while reserving the Gemfile to add version constraints for third-party dependencies like ffi and those that require a conditional, e.g.
if RUBY_VERSION >= '2.4' - figure out why rubocop lib passes on core
frozen string literal - run with --only Style/FrozenStringLiteralComment, why it doesn't detect offences without --only?
lib/rspec/core/backport_random.rb excluded - <<- chomp gsub unindent dedent -> <<~
- remove write_file_formatted in rspec-core
- bump cucumber to
kwargs delegation
- 💚 Regression in rspec-expectations 3.9.3 if argument to predicate method implements to_hash rspec-expectations#1221 (comment)
⚠️ Keyword args support causes expected values to coerce to Hash rspec-expectations#1241 (comment)- https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/#a-compatible-delegation
- https://eregon.me/blog/2019/11/10/the-delegation-challenge-of-ruby27.html
- https://github.com/rspec/rspec-expectations/pull/1222/files#r513326762
- Compatibility of shared_examples with Ruby 3 rspec-core#2674
- https://github.com/rspec/rspec-core/pull/2716/files
- rspec/rspec-expectations@964196a