From c6315d6e899796d3d0203dc8b656708a3ebca9a1 Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Fri, 30 Oct 2020 14:40:24 +0000 Subject: [PATCH 001/104] Version 3.10.0 --- Changelog.md | 4 ++-- lib/rspec/core/version.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Changelog.md b/Changelog.md index b5e5fd329a..d342d7f56f 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,5 +1,5 @@ -### Development -[Full Changelog](http://github.com/rspec/rspec-core/compare/v3.9.3...main) +### 3.10.0 / 2020-10-30 +[Full Changelog](http://github.com/rspec/rspec-core/compare/v3.9.3...v3.10.0) Enhancements: diff --git a/lib/rspec/core/version.rb b/lib/rspec/core/version.rb index d6f0219b3d..97a58aefe8 100644 --- a/lib/rspec/core/version.rb +++ b/lib/rspec/core/version.rb @@ -3,7 +3,7 @@ module Core # Version information for RSpec Core. module Version # Current version of RSpec Core, in semantic versioning format. - STRING = '3.10.0.pre' + STRING = '3.11.0.pre' end end end From 091f776914760bc8c871022a83bfdcc29e5db4c6 Mon Sep 17 00:00:00 2001 From: Matheus Richard Date: Fri, 30 Oct 2020 12:06:30 -0300 Subject: [PATCH 002/104] Allow ordering specs by modification time --- features/command_line/order.md | 3 +++ lib/rspec/core/option_parser.rb | 9 +++++---- lib/rspec/core/ordering.rb | 11 +++++++++++ spec/rspec/core/ordering_spec.rb | 17 +++++++++++++++++ 4 files changed, 36 insertions(+), 4 deletions(-) diff --git a/features/command_line/order.md b/features/command_line/order.md index 92eeb28251..77c4e55eff 100644 --- a/features/command_line/order.md +++ b/features/command_line/order.md @@ -13,6 +13,8 @@ order of groups at each level is randomized. With `rand` you can also specify a seed. +The option `modification_time` will run the most recent modified files first. You can combine it with `--next-failure` to find the most recent failing spec. + ## Example usage The `defined` option is only necessary when you have `--order rand` stored in a @@ -22,4 +24,5 @@ config file (e.g. `.rspec`) and you want to override it from the command line. --order rand --order rand:123 --seed 123 # same as --order rand:123 +--modification_time diff --git a/lib/rspec/core/option_parser.rb b/lib/rspec/core/option_parser.rb index c962374510..ac03c768d8 100644 --- a/lib/rspec/core/option_parser.rb +++ b/lib/rspec/core/option_parser.rb @@ -58,10 +58,11 @@ def parser(options) end parser.on('--order TYPE[:SEED]', 'Run examples by the specified order type.', - ' [defined] examples and groups are run in the order they are defined', - ' [rand] randomize the order of groups and examples', - ' [random] alias for rand', - ' [random:SEED] e.g. --order random:123') do |o| + ' [defined] examples and groups are run in the order they are defined', + ' [rand] randomize the order of groups and examples', + ' [random] alias for rand', + ' [random:SEED] e.g. --order random:123', + ' [modification_time] run the most recently modified files first') do |o| options[:order] = o end diff --git a/lib/rspec/core/ordering.rb b/lib/rspec/core/ordering.rb index f2284fb0d7..676e940fcd 100644 --- a/lib/rspec/core/ordering.rb +++ b/lib/rspec/core/ordering.rb @@ -58,6 +58,14 @@ def jenkins_hash_digest(string) MAX_32_BIT = 4_294_967_295 end + # @private + # Orders items by modification time (most recent modified first). + class ModificationTime + def order(list) + list.sort_by { |item| -File.mtime(item.metadata[:absolute_file_path]).to_i } + end + end + # @private # Orders items based on a custom block. class Custom @@ -78,6 +86,7 @@ def initialize(configuration) @strategies = {} register(:random, Random.new(configuration)) + register(:modification_time, ModificationTime.new) identity = Identity.new register(:defined, identity) @@ -132,6 +141,8 @@ def order=(type) :random elsif order == 'defined' :defined + elsif order == 'modification_time' + :modification_time end register_ordering(:global, ordering_registry.fetch(ordering_name)) if ordering_name diff --git a/spec/rspec/core/ordering_spec.rb b/spec/rspec/core/ordering_spec.rb index 579150c8ba..0bec69e110 100644 --- a/spec/rspec/core/ordering_spec.rb +++ b/spec/rspec/core/ordering_spec.rb @@ -81,6 +81,23 @@ def order_with(seed) end end + RSpec.describe ModificationTime do + require 'time' + + before do + allow(File).to receive(:mtime).with('./file_1.rb').and_return(::Time.parse('18:00')) + allow(File).to receive(:mtime).with('./file_2.rb').and_return(::Time.parse('18:01')) + end + + it 'orders list by file modification time' do + file_1 = instance_double(Example, :metadata => { :absolute_file_path => './file_1.rb' }) + file_2 = instance_double(Example, :metadata => { :absolute_file_path => './file_2.rb' }) + strategy = ModificationTime.new + + expect(strategy.order([file_1, file_2])).to eq([file_2, file_1]) + end + end + RSpec.describe Custom do it 'uses the block to order the list' do strategy = Custom.new(proc { |list| list.reverse }) From bc884198d5057412f52a37a84834b75ae3e91545 Mon Sep 17 00:00:00 2001 From: Matheus Richard Date: Fri, 30 Oct 2020 15:51:39 -0300 Subject: [PATCH 003/104] Update description for modification_time ordering --- features/command_line/order.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/features/command_line/order.md b/features/command_line/order.md index 77c4e55eff..8047839a51 100644 --- a/features/command_line/order.md +++ b/features/command_line/order.md @@ -13,7 +13,8 @@ order of groups at each level is randomized. With `rand` you can also specify a seed. -The option `modification_time` will run the most recent modified files first. You can combine it with `--next-failure` to find the most recent failing spec. +Use `modification_time` to run the most recently modified files first. You can +combine it with `--next-failure` to find the most recent failing spec. ## Example usage From dbb5271d41471eefbe7ba542d27dda36bf371d81 Mon Sep 17 00:00:00 2001 From: Matheus Richard Date: Fri, 30 Oct 2020 17:19:02 -0300 Subject: [PATCH 004/104] Remove require 'time' --- spec/rspec/core/ordering_spec.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/spec/rspec/core/ordering_spec.rb b/spec/rspec/core/ordering_spec.rb index 0bec69e110..7ea9b6acac 100644 --- a/spec/rspec/core/ordering_spec.rb +++ b/spec/rspec/core/ordering_spec.rb @@ -82,11 +82,9 @@ def order_with(seed) end RSpec.describe ModificationTime do - require 'time' - before do - allow(File).to receive(:mtime).with('./file_1.rb').and_return(::Time.parse('18:00')) - allow(File).to receive(:mtime).with('./file_2.rb').and_return(::Time.parse('18:01')) + allow(File).to receive(:mtime).with('./file_1.rb').and_return(::Time.new) + allow(File).to receive(:mtime).with('./file_2.rb').and_return(::Time.new + 1) end it 'orders list by file modification time' do From 8f9ed9972d3a1fe58122e62458103d39cffd8d95 Mon Sep 17 00:00:00 2001 From: Matheus Richard Date: Sat, 31 Oct 2020 23:04:12 -0300 Subject: [PATCH 005/104] Remove double spaces --- lib/rspec/core/ordering.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/rspec/core/ordering.rb b/lib/rspec/core/ordering.rb index 676e940fcd..eea6b1a679 100644 --- a/lib/rspec/core/ordering.rb +++ b/lib/rspec/core/ordering.rb @@ -85,8 +85,8 @@ def initialize(configuration) @configuration = configuration @strategies = {} - register(:random, Random.new(configuration)) - register(:modification_time, ModificationTime.new) + register(:random, Random.new(configuration)) + register(:modification_time, ModificationTime.new) identity = Identity.new register(:defined, identity) From 42b0abf298ea5c57d68a42c05454cb7c478ee097 Mon Sep 17 00:00:00 2001 From: Matheus Richard Date: Tue, 3 Nov 2020 12:37:57 -0300 Subject: [PATCH 006/104] Rename modification time to recently modified ordering --- features/command_line/order.md | 7 ++++--- lib/rspec/core/option_parser.rb | 2 +- lib/rspec/core/ordering.rb | 8 ++++---- spec/rspec/core/ordering_spec.rb | 4 ++-- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/features/command_line/order.md b/features/command_line/order.md index 8047839a51..c60cfd0ce9 100644 --- a/features/command_line/order.md +++ b/features/command_line/order.md @@ -13,8 +13,9 @@ order of groups at each level is randomized. With `rand` you can also specify a seed. -Use `modification_time` to run the most recently modified files first. You can -combine it with `--next-failure` to find the most recent failing spec. +Use `recently-modified` to run the most recently modified files first. You can +combine it with `--only-failures` to find the most recent failing specs. Note +that `recently-modified` and `rand` are mutually exclusives. ## Example usage @@ -25,5 +26,5 @@ config file (e.g. `.rspec`) and you want to override it from the command line. --order rand --order rand:123 --seed 123 # same as --order rand:123 ---modification_time +--order recently-modified diff --git a/lib/rspec/core/option_parser.rb b/lib/rspec/core/option_parser.rb index ac03c768d8..b095933eda 100644 --- a/lib/rspec/core/option_parser.rb +++ b/lib/rspec/core/option_parser.rb @@ -62,7 +62,7 @@ def parser(options) ' [rand] randomize the order of groups and examples', ' [random] alias for rand', ' [random:SEED] e.g. --order random:123', - ' [modification_time] run the most recently modified files first') do |o| + ' [recently-modified] run the most recently modified files first') do |o| options[:order] = o end diff --git a/lib/rspec/core/ordering.rb b/lib/rspec/core/ordering.rb index eea6b1a679..d852324dc5 100644 --- a/lib/rspec/core/ordering.rb +++ b/lib/rspec/core/ordering.rb @@ -60,7 +60,7 @@ def jenkins_hash_digest(string) # @private # Orders items by modification time (most recent modified first). - class ModificationTime + class RecentlyModified def order(list) list.sort_by { |item| -File.mtime(item.metadata[:absolute_file_path]).to_i } end @@ -86,7 +86,7 @@ def initialize(configuration) @strategies = {} register(:random, Random.new(configuration)) - register(:modification_time, ModificationTime.new) + register(:recently_modified, RecentlyModified.new) identity = Identity.new register(:defined, identity) @@ -141,8 +141,8 @@ def order=(type) :random elsif order == 'defined' :defined - elsif order == 'modification_time' - :modification_time + elsif order == 'recently-modified' + :recently_modified end register_ordering(:global, ordering_registry.fetch(ordering_name)) if ordering_name diff --git a/spec/rspec/core/ordering_spec.rb b/spec/rspec/core/ordering_spec.rb index 7ea9b6acac..d68a628e87 100644 --- a/spec/rspec/core/ordering_spec.rb +++ b/spec/rspec/core/ordering_spec.rb @@ -81,7 +81,7 @@ def order_with(seed) end end - RSpec.describe ModificationTime do + RSpec.describe RecentlyModified do before do allow(File).to receive(:mtime).with('./file_1.rb').and_return(::Time.new) allow(File).to receive(:mtime).with('./file_2.rb').and_return(::Time.new + 1) @@ -90,7 +90,7 @@ def order_with(seed) it 'orders list by file modification time' do file_1 = instance_double(Example, :metadata => { :absolute_file_path => './file_1.rb' }) file_2 = instance_double(Example, :metadata => { :absolute_file_path => './file_2.rb' }) - strategy = ModificationTime.new + strategy = RecentlyModified.new expect(strategy.order([file_1, file_2])).to eq([file_2, file_1]) end From a9a3d388b7e5b6eb4387eefffd85322f4e470f61 Mon Sep 17 00:00:00 2001 From: Matheus Richard Date: Tue, 3 Nov 2020 12:49:06 -0300 Subject: [PATCH 007/104] Add integration specs for recently modified ordering --- spec/integration/order_spec.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/spec/integration/order_spec.rb b/spec/integration/order_spec.rb index f492971a45..d1cdb7ee34 100644 --- a/spec/integration/order_spec.rb +++ b/spec/integration/order_spec.rb @@ -130,6 +130,17 @@ end end + describe '--order rand --order recently-modified' do + it 'overrides random ordering with recently-modified option' do + 2.times { run_command 'spec/order_spec.rb --order rand --order recently-modified -f doc' } + + expect(stdout.string).not_to match(/Randomized with seed/) + + top_level_groups { |first_run, second_run| expect(first_run).to eq(second_run) } + nested_groups { |first_run, second_run| expect(first_run).to eq(second_run) } + end + end + describe '--order defined on CLI with --order rand in .rspec' do after { remove '.rspec' } From bfd2b31884a2a46a10f7112b60dc5fc1d7543c22 Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Mon, 16 Nov 2020 09:31:10 +0000 Subject: [PATCH 008/104] Updated ci build scripts (from rspec-dev) --- .github/workflows/ci.yml | 38 +++++++++++++++++++ .rubocop_rspec_base.yml | 2 +- .travis.yml | 12 +----- appveyor.yml | 2 +- .../{travis_functions.sh => ci_functions.sh} | 2 +- script/clone_all_rspec_repos | 2 +- script/functions.sh | 4 +- script/predicate_functions.sh | 2 +- script/run_build | 2 +- script/update_rubygems_and_install_bundler | 2 +- 10 files changed, 49 insertions(+), 19 deletions(-) create mode 100644 .github/workflows/ci.yml rename script/{travis_functions.sh => ci_functions.sh} (96%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000000..438855e7c0 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,38 @@ +# This file was generated on 2020-11-16T09:31:10+00:00 from the rspec-dev repo. +# DO NOT modify it by hand as your changes will get lost the next time it is generated. + +name: RSpec CI +on: [pull_request, push] +jobs: + test: + name: Ruby ${{ matrix.ruby }} + runs-on: ubuntu-20.04 + strategy: + matrix: + ruby: + - 3.0.0-preview1 + - 2.7 + - 2.6 + - 2.5 + - 2.4 + - 2.3 + - 2.2 + - 2.1.9 + - ruby-head + fail-fast: false + continue-on-error: ${{ matrix.ruby == 'jruby-9.2.13.0' || endsWith(matrix.ruby, 'head') }} + steps: + - uses: actions/checkout@v2 + - uses: ruby/setup-ruby@v1 + with: + bundler: ${{ (matrix.ruby == 'jruby-9.1.17.0' && 1) || 2 }} + ruby-version: ${{ matrix.ruby }} + bundler-cache: true + - uses: actions/cache@v2 + with: + path: ../bundle + key: ${{ runner.os }}-${{ matrix.ruby }} + - run: script/update_rubygems_and_install_bundler + - run: script/clone_all_rspec_repos + - run: bundle install --binstubs --standalone + - run: script/run_build diff --git a/.rubocop_rspec_base.yml b/.rubocop_rspec_base.yml index 4743e12d34..7b9f183517 100644 --- a/.rubocop_rspec_base.yml +++ b/.rubocop_rspec_base.yml @@ -1,4 +1,4 @@ -# This file was generated on 2020-09-28T21:53:37+02:00 from the rspec-dev repo. +# This file was generated on 2020-11-16T09:31:10+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. # This file contains defaults for RSpec projects. Individual projects diff --git a/.travis.yml b/.travis.yml index a7a79dc7a7..c6c16b5498 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ -# This file was generated on 2020-09-28T21:53:37+02:00 from the rspec-dev repo. +# This file was generated on 2020-11-16T09:31:10+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. # In order to install old Rubies, we need to use old Ubuntu distibution. @@ -19,15 +19,6 @@ rvm: - 1.9.2 - 1.9.3 - 2.0.0 - - 2.1 - - 2.2.10 - - 2.3.8 - - 2.4.10 - - 2.5.8 - - 2.6.6 - - 2.7.1 - - ruby-3.0.0-preview1 - - ruby-head - ree - rbx-3 - jruby-9.1.7.0 # pin JRuby to this until travis/rvm can install later versions @@ -52,3 +43,4 @@ branches: only: - main - /^\d+-\d+-maintenance$/ + - /^\d+-\d+-dev$/ diff --git a/appveyor.yml b/appveyor.yml index d01ae06d71..758ab14e1d 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -# This file was generated on 2020-09-28T21:53:37+02:00 from the rspec-dev repo. +# This file was generated on 2020-11-16T09:31:10+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. version: "{build}" diff --git a/script/travis_functions.sh b/script/ci_functions.sh similarity index 96% rename from script/travis_functions.sh rename to script/ci_functions.sh index 6aa13ff24e..576572b480 100644 --- a/script/travis_functions.sh +++ b/script/ci_functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2020-09-28T21:53:37+02:00 from the rspec-dev repo. +# This file was generated on 2020-11-16T09:31:10+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. # Taken from: diff --git a/script/clone_all_rspec_repos b/script/clone_all_rspec_repos index d892143b0c..407f9d8015 100755 --- a/script/clone_all_rspec_repos +++ b/script/clone_all_rspec_repos @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2020-09-28T21:53:37+02:00 from the rspec-dev repo. +# This file was generated on 2020-11-16T09:31:10+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e diff --git a/script/functions.sh b/script/functions.sh index f65baeede4..1d8006154c 100644 --- a/script/functions.sh +++ b/script/functions.sh @@ -1,8 +1,8 @@ -# This file was generated on 2020-09-28T21:53:37+02:00 from the rspec-dev repo. +# This file was generated on 2020-11-16T09:31:10+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -source $SCRIPT_DIR/travis_functions.sh +source $SCRIPT_DIR/ci_functions.sh source $SCRIPT_DIR/predicate_functions.sh # If JRUBY_OPTS isn't set, use these. diff --git a/script/predicate_functions.sh b/script/predicate_functions.sh index 3c4b4a13e9..9714670403 100644 --- a/script/predicate_functions.sh +++ b/script/predicate_functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2020-09-28T21:53:37+02:00 from the rspec-dev repo. +# This file was generated on 2020-11-16T09:31:10+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. function is_mri { diff --git a/script/run_build b/script/run_build index 87fb8a6ad1..62a6eab883 100755 --- a/script/run_build +++ b/script/run_build @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2020-09-28T21:53:37+02:00 from the rspec-dev repo. +# This file was generated on 2020-11-16T09:31:10+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e diff --git a/script/update_rubygems_and_install_bundler b/script/update_rubygems_and_install_bundler index 5d4428ba51..6b3e8011d0 100755 --- a/script/update_rubygems_and_install_bundler +++ b/script/update_rubygems_and_install_bundler @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2020-09-28T21:53:37+02:00 from the rspec-dev repo. +# This file was generated on 2020-11-16T09:31:10+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e From e3e003e454e54d0e41565f49238006a6b0e5a2ed Mon Sep 17 00:00:00 2001 From: Joshua Pinter Date: Sun, 15 Nov 2020 11:49:46 -0700 Subject: [PATCH 009/104] Allow `pluralize` to handle words that end with s. Use Case: We have a custom formatter that we use with `parallel_tests` to get a cleaner output from the various test processes. We make use of `RSpec::Core::Formatters::Helpers.pluralize` in there to display the number of remaining processes left. However, instead of getting "processes", we get "processs". Looking into the `pluralize` method definition, it simple adds an "s" to the end of the provided String, unless the count is equal to 1. Without accounting for all the different words that are possible, which something like Rails would do, we just extended this to add "es" if the provided String ends in "s" already. We also added tests for words that end in "s" and words that do not end in "s". --- lib/rspec/core/formatters/helpers.rb | 10 ++++++- spec/rspec/core/formatters/helpers_spec.rb | 33 ++++++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/lib/rspec/core/formatters/helpers.rb b/lib/rspec/core/formatters/helpers.rb index 112a006b7c..f62709da8d 100644 --- a/lib/rspec/core/formatters/helpers.rb +++ b/lib/rspec/core/formatters/helpers.rb @@ -86,7 +86,15 @@ def self.strip_trailing_zeroes(string) # @param string [String] word to be pluralized # @return [String] pluralized word def self.pluralize(count, string) - "#{count} #{string}#{'s' unless count.to_f == 1}" + pluralized_string = if count.to_f == 1 + string + elsif string.end_with?('s') # e.g. "process" + "#{string}es" # e.g. "processes" + else + "#{string}s" + end + + "#{count} #{pluralized_string}" end # @api private diff --git a/spec/rspec/core/formatters/helpers_spec.rb b/spec/rspec/core/formatters/helpers_spec.rb index 491515adec..238bd6a99e 100644 --- a/spec/rspec/core/formatters/helpers_spec.rb +++ b/spec/rspec/core/formatters/helpers_spec.rb @@ -117,5 +117,38 @@ end end + describe "pluralize" do + context "when word does not end in s" do + let(:word){ "second" } + + it "pluralizes with 0" do + expect(helper.pluralize(0, "second")).to eq("0 seconds") + end + + it "does not pluralizes with 1" do + expect(helper.pluralize(1, "second")).to eq("1 second") + end + + it "pluralizes with 2" do + expect(helper.pluralize(2, "second")).to eq("2 seconds") + end + end + + context "when word ends in s" do + let(:word){ "process" } + + it "pluralizes with 0" do + expect(helper.pluralize(0, "process")).to eq("0 processes") + end + + it "does not pluralizes with 1" do + expect(helper.pluralize(1, "process")).to eq("1 process") + end + + it "pluralizes with 2" do + expect(helper.pluralize(2, "process")).to eq("2 processes") + end + end + end end From 32d2150eaae8af52edb6ee7fc87d5ab3f551f3de Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Mon, 16 Nov 2020 16:42:53 +0000 Subject: [PATCH 010/104] Change log for #2779 --- Changelog.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Changelog.md b/Changelog.md index d342d7f56f..8096fb125f 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,3 +1,9 @@ +### Development + +Enhancements: + +* Improve pluralisation of words ending with `s` (like process). (Joshua Pinter, #2779) + ### 3.10.0 / 2020-10-30 [Full Changelog](http://github.com/rspec/rspec-core/compare/v3.9.3...v3.10.0) From 002d51185dc5fc2d57aeeae755b654a54a9cd4e4 Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Mon, 16 Nov 2020 22:10:29 +0000 Subject: [PATCH 011/104] Updated ci build scripts (from rspec-dev) --- .github/workflows/ci.yml | 16 ++++++++++------ .rubocop_rspec_base.yml | 2 +- .travis.yml | 2 +- appveyor.yml | 2 +- script/ci_functions.sh | 2 +- script/clone_all_rspec_repos | 2 +- script/functions.sh | 2 +- script/predicate_functions.sh | 2 +- script/run_build | 2 +- script/update_rubygems_and_install_bundler | 2 +- 10 files changed, 19 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 438855e7c0..8f8bb74aca 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,8 +1,16 @@ -# This file was generated on 2020-11-16T09:31:10+00:00 from the rspec-dev repo. +# This file was generated on 2020-11-16T22:10:29+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. name: RSpec CI -on: [pull_request, push] +on: + push: + branches: + - 'main' + - '*-maintenance' + - '*-dev' + pull_request: + branches: + - '*' jobs: test: name: Ruby ${{ matrix.ruby }} @@ -28,10 +36,6 @@ jobs: bundler: ${{ (matrix.ruby == 'jruby-9.1.17.0' && 1) || 2 }} ruby-version: ${{ matrix.ruby }} bundler-cache: true - - uses: actions/cache@v2 - with: - path: ../bundle - key: ${{ runner.os }}-${{ matrix.ruby }} - run: script/update_rubygems_and_install_bundler - run: script/clone_all_rspec_repos - run: bundle install --binstubs --standalone diff --git a/.rubocop_rspec_base.yml b/.rubocop_rspec_base.yml index 7b9f183517..00581e870f 100644 --- a/.rubocop_rspec_base.yml +++ b/.rubocop_rspec_base.yml @@ -1,4 +1,4 @@ -# This file was generated on 2020-11-16T09:31:10+00:00 from the rspec-dev repo. +# This file was generated on 2020-11-16T22:10:29+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. # This file contains defaults for RSpec projects. Individual projects diff --git a/.travis.yml b/.travis.yml index c6c16b5498..953515fb02 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ -# This file was generated on 2020-11-16T09:31:10+00:00 from the rspec-dev repo. +# This file was generated on 2020-11-16T22:10:29+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. # In order to install old Rubies, we need to use old Ubuntu distibution. diff --git a/appveyor.yml b/appveyor.yml index 758ab14e1d..79bc79a324 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -# This file was generated on 2020-11-16T09:31:10+00:00 from the rspec-dev repo. +# This file was generated on 2020-11-16T22:10:29+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. version: "{build}" diff --git a/script/ci_functions.sh b/script/ci_functions.sh index 576572b480..38f4064ae3 100644 --- a/script/ci_functions.sh +++ b/script/ci_functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2020-11-16T09:31:10+00:00 from the rspec-dev repo. +# This file was generated on 2020-11-16T22:10:29+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. # Taken from: diff --git a/script/clone_all_rspec_repos b/script/clone_all_rspec_repos index 407f9d8015..9ba9631cd0 100755 --- a/script/clone_all_rspec_repos +++ b/script/clone_all_rspec_repos @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2020-11-16T09:31:10+00:00 from the rspec-dev repo. +# This file was generated on 2020-11-16T22:10:29+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e diff --git a/script/functions.sh b/script/functions.sh index 1d8006154c..0716529f39 100644 --- a/script/functions.sh +++ b/script/functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2020-11-16T09:31:10+00:00 from the rspec-dev repo. +# This file was generated on 2020-11-16T22:10:29+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" diff --git a/script/predicate_functions.sh b/script/predicate_functions.sh index 9714670403..ca2ca30018 100644 --- a/script/predicate_functions.sh +++ b/script/predicate_functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2020-11-16T09:31:10+00:00 from the rspec-dev repo. +# This file was generated on 2020-11-16T22:10:29+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. function is_mri { diff --git a/script/run_build b/script/run_build index 62a6eab883..a6aebb2bc1 100755 --- a/script/run_build +++ b/script/run_build @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2020-11-16T09:31:10+00:00 from the rspec-dev repo. +# This file was generated on 2020-11-16T22:10:29+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e diff --git a/script/update_rubygems_and_install_bundler b/script/update_rubygems_and_install_bundler index 6b3e8011d0..f244a3f155 100755 --- a/script/update_rubygems_and_install_bundler +++ b/script/update_rubygems_and_install_bundler @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2020-11-16T09:31:10+00:00 from the rspec-dev repo. +# This file was generated on 2020-11-16T22:10:29+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e From 219fb1ae43d3e62938faaf45337e1ba3d48f456e Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Wed, 18 Nov 2020 09:45:41 +0000 Subject: [PATCH 012/104] Updated ci build scripts (from rspec-dev) --- .github/workflows/ci.yml | 26 +++++++++++++- .rubocop_rspec_base.yml | 2 +- .travis.yml | 2 +- appveyor.yml | 42 ---------------------- script/ci_functions.sh | 2 +- script/clone_all_rspec_repos | 2 +- script/functions.sh | 2 +- script/predicate_functions.sh | 2 +- script/run_build | 2 +- script/update_rubygems_and_install_bundler | 2 +- 10 files changed, 33 insertions(+), 51 deletions(-) delete mode 100644 appveyor.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8f8bb74aca..70c3531e7c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -# This file was generated on 2020-11-16T22:10:29+00:00 from the rspec-dev repo. +# This file was generated on 2020-11-18T09:45:41+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. name: RSpec CI @@ -40,3 +40,27 @@ jobs: - run: script/clone_all_rspec_repos - run: bundle install --binstubs --standalone - run: script/run_build + + windows: + name: Ruby ${{ matrix.ruby }} (Windows) + runs-on: windows-latest + strategy: + matrix: + ruby: + - 2.7 + - 2.6 + - 2.5 + - 2.4 + - 2.3 + - 2.2 + - 2.1.9 + fail-fast: false + steps: + - uses: actions/checkout@v2 + - uses: ruby/setup-ruby@v1 + with: + bundler: 2 + ruby-version: ${{ matrix.ruby }} + bundler-cache: true + - run: cinst ansicon + - run: bundle exec rspec --backtrace diff --git a/.rubocop_rspec_base.yml b/.rubocop_rspec_base.yml index 00581e870f..76b1b03dc5 100644 --- a/.rubocop_rspec_base.yml +++ b/.rubocop_rspec_base.yml @@ -1,4 +1,4 @@ -# This file was generated on 2020-11-16T22:10:29+00:00 from the rspec-dev repo. +# This file was generated on 2020-11-18T09:45:41+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. # This file contains defaults for RSpec projects. Individual projects diff --git a/.travis.yml b/.travis.yml index 953515fb02..fc0b5d440e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ -# This file was generated on 2020-11-16T22:10:29+00:00 from the rspec-dev repo. +# This file was generated on 2020-11-18T09:45:41+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. # In order to install old Rubies, we need to use old Ubuntu distibution. diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 79bc79a324..0000000000 --- a/appveyor.yml +++ /dev/null @@ -1,42 +0,0 @@ -# This file was generated on 2020-11-16T22:10:29+00:00 from the rspec-dev repo. -# DO NOT modify it by hand as your changes will get lost the next time it is generated. - -version: "{build}" - -# This will build all PRs targetting matching branches. -# Without this, each PR builds twice -- once for the PR branch HEAD, -# and once for the merge commit that github creates for each mergable PR. -branches: - only: - - main - - /.*-maintenance$/ - -# Disable normal Windows builds in favor of our test script. -build: off - -cache: - - vendor/bundle - -install: - - set PATH=C:\Ruby%RUBY_VERSION%\bin;%PATH% - - bundle config --local path vendor/bundle - - bundle install - - cinst ansicon - -before_test: - - ruby --version - - gem --version - - bundle --version - -test_script: - - bundle exec rspec --backtrace - -environment: - matrix: - - ruby_version: 200 - - ruby_version: 21 - - ruby_version: 22 - - ruby_version: 23-x64 - - ruby_version: 24-x64 - - ruby_version: 25-x64 - - ruby_version: 26-x64 diff --git a/script/ci_functions.sh b/script/ci_functions.sh index 38f4064ae3..b609ccc23a 100644 --- a/script/ci_functions.sh +++ b/script/ci_functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2020-11-16T22:10:29+00:00 from the rspec-dev repo. +# This file was generated on 2020-11-18T09:45:41+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. # Taken from: diff --git a/script/clone_all_rspec_repos b/script/clone_all_rspec_repos index 9ba9631cd0..f83c634ee9 100755 --- a/script/clone_all_rspec_repos +++ b/script/clone_all_rspec_repos @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2020-11-16T22:10:29+00:00 from the rspec-dev repo. +# This file was generated on 2020-11-18T09:45:41+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e diff --git a/script/functions.sh b/script/functions.sh index 0716529f39..770bda5649 100644 --- a/script/functions.sh +++ b/script/functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2020-11-16T22:10:29+00:00 from the rspec-dev repo. +# This file was generated on 2020-11-18T09:45:41+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" diff --git a/script/predicate_functions.sh b/script/predicate_functions.sh index ca2ca30018..3abc40cee1 100644 --- a/script/predicate_functions.sh +++ b/script/predicate_functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2020-11-16T22:10:29+00:00 from the rspec-dev repo. +# This file was generated on 2020-11-18T09:45:41+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. function is_mri { diff --git a/script/run_build b/script/run_build index a6aebb2bc1..2d2aa5c05b 100755 --- a/script/run_build +++ b/script/run_build @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2020-11-16T22:10:29+00:00 from the rspec-dev repo. +# This file was generated on 2020-11-18T09:45:41+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e diff --git a/script/update_rubygems_and_install_bundler b/script/update_rubygems_and_install_bundler index f244a3f155..de69b3c49f 100755 --- a/script/update_rubygems_and_install_bundler +++ b/script/update_rubygems_and_install_bundler @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2020-11-16T22:10:29+00:00 from the rspec-dev repo. +# This file was generated on 2020-11-18T09:45:41+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e From 5384bcd08d6f8ce0fb45be0418ba81274e28d32c Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Wed, 18 Nov 2020 11:00:13 +0000 Subject: [PATCH 013/104] Update FFI version --- Gemfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 6ad4e377db..b50ea038ce 100644 --- a/Gemfile +++ b/Gemfile @@ -44,8 +44,10 @@ if RUBY_VERSION < '2.2.0' && !!(RbConfig::CONFIG['host_os'] =~ /cygwin|mswin|min gem 'ffi', '< 1.10' elsif RUBY_VERSION < '2.0' gem 'ffi', '< 1.9.19' # ffi dropped Ruby 1.8 support in 1.9.19 +elsif RUBY_VERSION < '2.3.0' + gem 'ffi', '~> 1.12.0' else - gem 'ffi', '~> 1.11.0' + gem 'ffi', '~> 1.13.0' end if RUBY_VERSION < '2.3.0' && !!(RbConfig::CONFIG['host_os'] =~ /cygwin|mswin|mingw|bccwin|wince|emx/) From a44139acda0ec24d7cdb0b736277650bd9d6dacd Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Wed, 18 Nov 2020 11:02:02 +0000 Subject: [PATCH 014/104] Update windows checks for github actions --- spec/integration/bisect_spec.rb | 4 ---- spec/rspec/core/configuration_spec.rb | 6 ++---- spec/rspec/core/rake_task_spec.rb | 6 ++---- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/spec/integration/bisect_spec.rb b/spec/integration/bisect_spec.rb index 820ca4d8c9..74fbf57995 100644 --- a/spec/integration/bisect_spec.rb +++ b/spec/integration/bisect_spec.rb @@ -4,10 +4,6 @@ module RSpec::Core RSpec.describe "Bisect", :slow, :simulate_shell_allowing_unquoted_ids do include FormatterSupport - before do - skip "These specs do not consistently pass or fail on AppVeyor on Ruby 2.1+" - end if ENV['APPVEYOR'] && RUBY_VERSION.to_f > 2.0 - def bisect(cli_args, expected_status=nil) options = ConfigurationOptions.new(cli_args) diff --git a/spec/rspec/core/configuration_spec.rb b/spec/rspec/core/configuration_spec.rb index 2ea3622817..f15e662f57 100644 --- a/spec/rspec/core/configuration_spec.rb +++ b/spec/rspec/core/configuration_spec.rb @@ -535,9 +535,7 @@ def stub_expectation_adapters expect(config.files_to_run).to contain_files("./spec/rspec/core/resources/a_spec.rb") end - it "supports absolute path patterns", :failing_on_appveyor, - :pending => false, - :skip => (ENV['APPVEYOR'] ? "Failing on AppVeyor but :pending isn't working for some reason" : false) do + it "supports absolute path patterns" do dir = File.expand_path("../resources", __FILE__) config.pattern = File.join(dir, "**/*_spec.rb") assign_files_or_directories_to_run "spec" @@ -618,7 +616,7 @@ def stub_expectation_adapters expect(config.files_to_run).to contain_files("C:/path/to/project/spec/sub/foo_spec.rb") end - it "loads files in Windows when directory is specified", :failing_on_appveyor, :if => RSpec::Support::OS.windows? do + it "loads files in Windows when directory is specified", :failing_on_windows_ci, :if => RSpec::Support::OS.windows? do assign_files_or_directories_to_run "spec\\rspec\\core\\resources" expect(config.files_to_run).to contain_files("spec/rspec/core/resources/a_spec.rb") end diff --git a/spec/rspec/core/rake_task_spec.rb b/spec/rspec/core/rake_task_spec.rb index ae2c9e636f..3f11232eab 100644 --- a/spec/rspec/core/rake_task_spec.rb +++ b/spec/rspec/core/rake_task_spec.rb @@ -308,9 +308,7 @@ def self.it_configures_rspec_load_path(description, path_template) end context "that is an absolute path file glob" do - it "loads the matching spec files", :failing_on_appveyor, - :pending => false, - :skip => (ENV['APPVEYOR'] ? "Failing on AppVeyor but :pending isn't working for some reason" : false) do + it "loads the matching spec files" do dir = File.expand_path("../resources", __FILE__) task.pattern = File.join(dir, "**/*_spec.rb") @@ -443,7 +441,7 @@ def make_files_in_dir(dir) context "with paths with quotes or spaces" do include_context "isolated directory" - it "matches files with quotes and spaces", :failing_on_appveyor do + it "matches files with quotes and spaces", :failing_on_windows_ci do spec_dir = File.join(Dir.getwd, "spec") task.pattern = "spec/*spec.rb" FileUtils.mkdir_p(spec_dir) From 09cafac4cbd65ab76e4452d2c29ecb74693b454b Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Thu, 19 Nov 2020 19:31:07 +0000 Subject: [PATCH 015/104] Ignore warnings from two examples on windows --- spec/rspec/core/configuration_spec.rb | 2 +- spec/rspec/core/rake_task_spec.rb | 2 +- spec/spec_helper.rb | 10 ++++++++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/spec/rspec/core/configuration_spec.rb b/spec/rspec/core/configuration_spec.rb index f15e662f57..83b740bd36 100644 --- a/spec/rspec/core/configuration_spec.rb +++ b/spec/rspec/core/configuration_spec.rb @@ -535,7 +535,7 @@ def stub_expectation_adapters expect(config.files_to_run).to contain_files("./spec/rspec/core/resources/a_spec.rb") end - it "supports absolute path patterns" do + it "supports absolute path patterns", :emits_warning_on_windows_on_old_ruby do dir = File.expand_path("../resources", __FILE__) config.pattern = File.join(dir, "**/*_spec.rb") assign_files_or_directories_to_run "spec" diff --git a/spec/rspec/core/rake_task_spec.rb b/spec/rspec/core/rake_task_spec.rb index 3f11232eab..96b82c8d21 100644 --- a/spec/rspec/core/rake_task_spec.rb +++ b/spec/rspec/core/rake_task_spec.rb @@ -308,7 +308,7 @@ def self.it_configures_rspec_load_path(description, path_template) end context "that is an absolute path file glob" do - it "loads the matching spec files" do + it "loads the matching spec files", :emits_warning_on_windows_on_old_ruby, :pending_on_windows_old_ruby do dir = File.expand_path("../resources", __FILE__) task.pattern = File.join(dir, "**/*_spec.rb") diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 4f75745a6d..da6f4f1975 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -97,6 +97,16 @@ def handle_current_dir_change with_env_vars('SHELL' => '/usr/local/bin/bash', &ex) end + if ENV['CI'] && RSpec::Support::OS.windows? && RUBY_VERSION.to_f < 2.3 + c.around(:example, :emits_warning_on_windows_on_old_ruby) do |ex| + ignoring_warnings(&ex) + end + + c.define_derived_metadata(:pending_on_windows_old_ruby => true) do |metadata| + metadata[:pending] = "This example is expected to fail on windows, on ruby older than 2.3" + end + end + c.filter_run_excluding :ruby => lambda {|version| case version.to_s when "!jruby" From b19bbd85bed66f82c416c7e5e453cdb4177ce5ef Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Sun, 22 Nov 2020 07:41:13 +0000 Subject: [PATCH 016/104] Updated ci build scripts (from rspec-dev) --- .github/workflows/ci.yml | 32 ++++++++++++++++++---- .rubocop_rspec_base.yml | 2 +- .travis.yml | 13 +-------- script/ci_functions.sh | 2 +- script/clone_all_rspec_repos | 2 +- script/functions.sh | 2 +- script/predicate_functions.sh | 2 +- script/run_build | 2 +- script/update_rubygems_and_install_bundler | 2 +- 9 files changed, 34 insertions(+), 25 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 70c3531e7c..023c590af0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -# This file was generated on 2020-11-18T09:45:41+00:00 from the rspec-dev repo. +# This file was generated on 2020-11-22T07:41:13+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. name: RSpec CI @@ -13,8 +13,8 @@ on: - '*' jobs: test: - name: Ruby ${{ matrix.ruby }} - runs-on: ubuntu-20.04 + name: Ruby ${{ matrix.ruby }} ${{ matrix.name_extra || '' }} + runs-on: ${{ matrix.os || 'ubuntu-20.04' }} strategy: matrix: ruby: @@ -27,15 +27,35 @@ jobs: - 2.2 - 2.1.9 - ruby-head + env: + - + DIFF_LCS_VERSION: "> 1.4.3" + include: + - ruby: jruby-9.2.13.0 + env: + JRUBY_OPTS: "--dev" + - ruby: jruby-9.1.17.0 + bundler: 1 + os: ubuntu-18.04 + env: + JRUBY_OPTS: "--dev" + - ruby: 2.7 + name_extra: "with diff-lcs 1.3" + env: + DIFF_LCS_VERSION: "~> 1.3.0" + - ruby: 2.7 + name_extra: "with diff-lcs 1.4.3" + env: + DIFF_LCS_VERSION: "1.4.3" fail-fast: false - continue-on-error: ${{ matrix.ruby == 'jruby-9.2.13.0' || endsWith(matrix.ruby, 'head') }} + continue-on-error: ${{ matrix.allow_failure || endsWith(matrix.ruby, 'head') }} + env: ${{ matrix.env }} steps: - uses: actions/checkout@v2 - uses: ruby/setup-ruby@v1 with: - bundler: ${{ (matrix.ruby == 'jruby-9.1.17.0' && 1) || 2 }} + bundler: ${{ matrix.bundler || 2 }} ruby-version: ${{ matrix.ruby }} - bundler-cache: true - run: script/update_rubygems_and_install_bundler - run: script/clone_all_rspec_repos - run: bundle install --binstubs --standalone diff --git a/.rubocop_rspec_base.yml b/.rubocop_rspec_base.yml index 76b1b03dc5..6a42ca4b6f 100644 --- a/.rubocop_rspec_base.yml +++ b/.rubocop_rspec_base.yml @@ -1,4 +1,4 @@ -# This file was generated on 2020-11-18T09:45:41+00:00 from the rspec-dev repo. +# This file was generated on 2020-11-22T07:41:13+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. # This file contains defaults for RSpec projects. Individual projects diff --git a/.travis.yml b/.travis.yml index fc0b5d440e..a381fd7129 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ -# This file was generated on 2020-11-18T09:45:41+00:00 from the rspec-dev repo. +# This file was generated on 2020-11-22T07:41:13+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. # In order to install old Rubies, we need to use old Ubuntu distibution. @@ -20,9 +20,6 @@ rvm: - 1.9.3 - 2.0.0 - ree - - rbx-3 - - jruby-9.1.7.0 # pin JRuby to this until travis/rvm can install later versions - - jruby-head - jruby-1.7 env: - JRUBY_OPTS='--dev' @@ -30,14 +27,6 @@ matrix: include: - rvm: jruby-1.7 env: JRUBY_OPTS='--dev --1.8' - - rvm: 2.7.1 - env: DIFF_LCS_VERSION="~> 1.3.0" - - rvm: 2.7.1 - env: DIFF_LCS_VERSION="1.4.3" - allow_failures: - - rvm: jruby-head - - rvm: ruby-head - - rvm: rbx-3 fast_finish: true branches: only: diff --git a/script/ci_functions.sh b/script/ci_functions.sh index b609ccc23a..5110b3622f 100644 --- a/script/ci_functions.sh +++ b/script/ci_functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2020-11-18T09:45:41+00:00 from the rspec-dev repo. +# This file was generated on 2020-11-22T07:41:13+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. # Taken from: diff --git a/script/clone_all_rspec_repos b/script/clone_all_rspec_repos index f83c634ee9..5f03a4c110 100755 --- a/script/clone_all_rspec_repos +++ b/script/clone_all_rspec_repos @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2020-11-18T09:45:41+00:00 from the rspec-dev repo. +# This file was generated on 2020-11-22T07:41:13+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e diff --git a/script/functions.sh b/script/functions.sh index 770bda5649..08e5bcb588 100644 --- a/script/functions.sh +++ b/script/functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2020-11-18T09:45:41+00:00 from the rspec-dev repo. +# This file was generated on 2020-11-22T07:41:13+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" diff --git a/script/predicate_functions.sh b/script/predicate_functions.sh index 3abc40cee1..2791503afc 100644 --- a/script/predicate_functions.sh +++ b/script/predicate_functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2020-11-18T09:45:41+00:00 from the rspec-dev repo. +# This file was generated on 2020-11-22T07:41:13+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. function is_mri { diff --git a/script/run_build b/script/run_build index 2d2aa5c05b..d4444c8b11 100755 --- a/script/run_build +++ b/script/run_build @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2020-11-18T09:45:41+00:00 from the rspec-dev repo. +# This file was generated on 2020-11-22T07:41:13+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e diff --git a/script/update_rubygems_and_install_bundler b/script/update_rubygems_and_install_bundler index de69b3c49f..558923ac85 100755 --- a/script/update_rubygems_and_install_bundler +++ b/script/update_rubygems_and_install_bundler @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2020-11-18T09:45:41+00:00 from the rspec-dev repo. +# This file was generated on 2020-11-22T07:41:13+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e From fb0f7497d27cfa01f95c065811d0e56121f75705 Mon Sep 17 00:00:00 2001 From: Matheus Richard Date: Fri, 4 Dec 2020 19:44:36 -0300 Subject: [PATCH 017/104] Update features/command_line/order.md Co-authored-by: Jon Rowe --- features/command_line/order.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/command_line/order.md b/features/command_line/order.md index c60cfd0ce9..c5bc0f15f0 100644 --- a/features/command_line/order.md +++ b/features/command_line/order.md @@ -15,7 +15,7 @@ With `rand` you can also specify a seed. Use `recently-modified` to run the most recently modified files first. You can combine it with `--only-failures` to find the most recent failing specs. Note -that `recently-modified` and `rand` are mutually exclusives. +that `recently-modified` and `rand` are mutually exclusive. ## Example usage From c23189bd46fce04b2be9136e156c9ae2124e312b Mon Sep 17 00:00:00 2001 From: Matheus Richard Date: Fri, 4 Dec 2020 19:46:34 -0300 Subject: [PATCH 018/104] Update spec/integration/order_spec.rb Co-authored-by: Jon Rowe --- spec/integration/order_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/integration/order_spec.rb b/spec/integration/order_spec.rb index d1cdb7ee34..b716ab854e 100644 --- a/spec/integration/order_spec.rb +++ b/spec/integration/order_spec.rb @@ -136,8 +136,8 @@ expect(stdout.string).not_to match(/Randomized with seed/) - top_level_groups { |first_run, second_run| expect(first_run).to eq(second_run) } - nested_groups { |first_run, second_run| expect(first_run).to eq(second_run) } + top_level_groups { |first_run, second_run| expect(first_run).to eq(second_run) } + nested_groups { |first_run, second_run| expect(first_run).to eq(second_run) } end end From cc542e6f0aaa747b41bdf800bc5ecb40eccab7b7 Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Sun, 6 Dec 2020 20:27:23 +0000 Subject: [PATCH 019/104] Pin ffi to 1.12.0 on JRuby due to the use of rubygems code in 1.13.0-1.13.1 --- Gemfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Gemfile b/Gemfile index b50ea038ce..174b4073ae 100644 --- a/Gemfile +++ b/Gemfile @@ -46,6 +46,9 @@ elsif RUBY_VERSION < '2.0' gem 'ffi', '< 1.9.19' # ffi dropped Ruby 1.8 support in 1.9.19 elsif RUBY_VERSION < '2.3.0' gem 'ffi', '~> 1.12.0' +elsif defined?(RUBY_PLATFORM) && RUBY_PLATFORM == 'java' + # Until 1.13.2 is released + gem 'ffi', '~> 1.12.0' else gem 'ffi', '~> 1.13.0' end From 08ef2ee4b26fd9ad975997263f5a28eb58c088e4 Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Sun, 6 Dec 2020 20:48:16 +0000 Subject: [PATCH 020/104] These examples are fixed on JRuby 9.2.x.x --- spec/rspec/core/formatters/exception_presenter_spec.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/spec/rspec/core/formatters/exception_presenter_spec.rb b/spec/rspec/core/formatters/exception_presenter_spec.rb index a87815a68f..199b71c453 100644 --- a/spec/rspec/core/formatters/exception_presenter_spec.rb +++ b/spec/rspec/core/formatters/exception_presenter_spec.rb @@ -509,7 +509,9 @@ def read_failed_lines context 'and the line count does not exceed RSpec.configuration.max_displayed_failure_line_count' do it 'returns all the lines' do - pending 'https://github.com/jruby/jruby/issues/4737' if RSpec::Support::Ruby.jruby_9000? + if RSpec::Support::Ruby.jruby_9000? && RSpec::Support::Ruby.jruby_version < '9.2.0.0' + pending 'https://github.com/jruby/jruby/issues/4737' + end expect(read_failed_lines).to eq([ " expect('RSpec').to be_a(String).", " and start_with('R').", @@ -524,7 +526,9 @@ def read_failed_lines end it 'returns the lines without exceeding the max count' do - pending 'https://github.com/jruby/jruby/issues/4737' if RSpec::Support::Ruby.jruby_9000? + if RSpec::Support::Ruby.jruby_9000? && RSpec::Support::Ruby.jruby_version < '9.2.0.0' + pending 'https://github.com/jruby/jruby/issues/4737' + end expect(read_failed_lines).to eq([ " expect('RSpec').to be_a(String).", " and start_with('R')." From e4b605d4326b7afd5c6c94fd1c1690cdfc41b41e Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Sun, 6 Dec 2020 21:09:08 +0000 Subject: [PATCH 021/104] Fix build for JRuby 9.2.x.x --- spec/integration/suite_hooks_errors_spec.rb | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/spec/integration/suite_hooks_errors_spec.rb b/spec/integration/suite_hooks_errors_spec.rb index b4a862d2fe..9932a54d76 100644 --- a/spec/integration/suite_hooks_errors_spec.rb +++ b/spec/integration/suite_hooks_errors_spec.rb @@ -8,7 +8,9 @@ let(:failure_exit_code) { rand(97) + 2 } # 2..99 let(:error_exit_code) { failure_exit_code + 2 } # 4..101 - if RSpec::Support::Ruby.jruby_9000? + if RSpec::Support::Ruby.jruby_9000? && RSpec::Support::Ruby.jruby_version > '9.2.0.0' + let(:spec_line_suffix) { ":in `block in
'" } + elsif RSpec::Support::Ruby.jruby_9000? let(:spec_line_suffix) { ":in `block in (root)'" } elsif RSpec::Support::Ruby.jruby? let(:spec_line_suffix) { ":in `(root)'" } @@ -97,6 +99,19 @@ def run_spec_expecting_non_zero(before_or_after) end " + cause = + if RSpec::Support::Ruby.jruby_9000? && RSpec::Support::Ruby.jruby_version > '9.2.0.0' + unindent(<<-EOS) + # ------------------ + # --- Caused by: --- + # RuntimeError: + # before 1 + # ./the_spec.rb:3:in `block in
' + EOS + else + "" + end + run_command "the_spec.rb" expect(last_cmd_exit_status).to eq(error_exit_code) output = normalize_durations(last_cmd_stdout) @@ -116,14 +131,14 @@ def run_spec_expecting_non_zero(before_or_after) RuntimeError: after 2 # ./the_spec.rb:6#{spec_line_suffix} - + #{ cause } An error occurred in an `after(:suite)` hook. Failure/Error: c.after(:suite) { raise 'after 1' } RuntimeError: after 1 # ./the_spec.rb:5#{spec_line_suffix} - + #{ cause } Finished in n.nnnn seconds (files took n.nnnn seconds to load) 0 examples, 0 failures, 3 errors occurred outside of examples From c6a0e0ac76e944541b7d2bac843220a67c573c69 Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Tue, 8 Dec 2020 09:05:15 +0000 Subject: [PATCH 022/104] Pin ffi --- Gemfile | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Gemfile b/Gemfile index 174b4073ae..85c0ac3297 100644 --- a/Gemfile +++ b/Gemfile @@ -46,11 +46,9 @@ elsif RUBY_VERSION < '2.0' gem 'ffi', '< 1.9.19' # ffi dropped Ruby 1.8 support in 1.9.19 elsif RUBY_VERSION < '2.3.0' gem 'ffi', '~> 1.12.0' -elsif defined?(RUBY_PLATFORM) && RUBY_PLATFORM == 'java' - # Until 1.13.2 is released - gem 'ffi', '~> 1.12.0' else - gem 'ffi', '~> 1.13.0' + # Until 1.13.2 is released due to Rubygems usage + gem 'ffi', '~> 1.12.0' end if RUBY_VERSION < '2.3.0' && !!(RbConfig::CONFIG['host_os'] =~ /cygwin|mswin|mingw|bccwin|wince|emx/) From f82087ad3a05d584d7dbcedba93e7d001922d8c4 Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Tue, 8 Dec 2020 21:16:12 +0000 Subject: [PATCH 023/104] Updated ci build scripts (from rspec-dev) --- .github/workflows/ci.yml | 2 +- .rubocop_rspec_base.yml | 2 +- .travis.yml | 2 +- script/ci_functions.sh | 2 +- script/clone_all_rspec_repos | 2 +- script/functions.sh | 15 ++++++++++++--- script/predicate_functions.sh | 2 +- script/run_build | 2 +- script/update_rubygems_and_install_bundler | 2 +- 9 files changed, 20 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 023c590af0..682f9d5224 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -# This file was generated on 2020-11-22T07:41:13+00:00 from the rspec-dev repo. +# This file was generated on 2020-12-08T21:16:12+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. name: RSpec CI diff --git a/.rubocop_rspec_base.yml b/.rubocop_rspec_base.yml index 6a42ca4b6f..4964eed88a 100644 --- a/.rubocop_rspec_base.yml +++ b/.rubocop_rspec_base.yml @@ -1,4 +1,4 @@ -# This file was generated on 2020-11-22T07:41:13+00:00 from the rspec-dev repo. +# This file was generated on 2020-12-08T21:16:12+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. # This file contains defaults for RSpec projects. Individual projects diff --git a/.travis.yml b/.travis.yml index a381fd7129..55bd920f36 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ -# This file was generated on 2020-11-22T07:41:13+00:00 from the rspec-dev repo. +# This file was generated on 2020-12-08T21:16:12+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. # In order to install old Rubies, we need to use old Ubuntu distibution. diff --git a/script/ci_functions.sh b/script/ci_functions.sh index 5110b3622f..5dae99c375 100644 --- a/script/ci_functions.sh +++ b/script/ci_functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2020-11-22T07:41:13+00:00 from the rspec-dev repo. +# This file was generated on 2020-12-08T21:16:12+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. # Taken from: diff --git a/script/clone_all_rspec_repos b/script/clone_all_rspec_repos index 5f03a4c110..d2465fcbe1 100755 --- a/script/clone_all_rspec_repos +++ b/script/clone_all_rspec_repos @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2020-11-22T07:41:13+00:00 from the rspec-dev repo. +# This file was generated on 2020-12-08T21:16:12+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e diff --git a/script/functions.sh b/script/functions.sh index 08e5bcb588..c1734a2103 100644 --- a/script/functions.sh +++ b/script/functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2020-11-22T07:41:13+00:00 from the rspec-dev repo. +# This file was generated on 2020-12-08T21:16:12+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" @@ -19,7 +19,13 @@ fi function clone_repo { if [ ! -d $1 ]; then # don't clone if the dir is already there - travis_retry eval "git clone https://github.com/rspec/$1 --depth 1 --branch $MAINTENANCE_BRANCH" + if [ -z "$2" ]; then + BRANCH_TO_CLONE="$MAINTENANCE_BRANCH" + else + BRANCH_TO_CLONE="$2" + fi + + travis_retry eval "git clone https://github.com/rspec/$1 --depth 1 --branch $BRANCH_TO_CLONE" fi; } @@ -82,7 +88,10 @@ function run_spec_suite_for { echo "Running specs for $1" pushd ../$1 unset BUNDLE_GEMFILE - bundle_install_flags=`cat .travis.yml | grep bundler_args | tr -d '"' | grep -o " .*"` + bundle_install_flags="" + if [ -e .travis.yml ]; then + bundle_install_flags=`cat .travis.yml | grep bundler_args | tr -d '"' | grep -o " .*"` + fi travis_retry eval "(unset RUBYOPT; exec bundle install $bundle_install_flags)" run_specs_and_record_done popd diff --git a/script/predicate_functions.sh b/script/predicate_functions.sh index 2791503afc..f1876d05f2 100644 --- a/script/predicate_functions.sh +++ b/script/predicate_functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2020-11-22T07:41:13+00:00 from the rspec-dev repo. +# This file was generated on 2020-12-08T21:16:12+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. function is_mri { diff --git a/script/run_build b/script/run_build index d4444c8b11..f5682141df 100755 --- a/script/run_build +++ b/script/run_build @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2020-11-22T07:41:13+00:00 from the rspec-dev repo. +# This file was generated on 2020-12-08T21:16:12+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e diff --git a/script/update_rubygems_and_install_bundler b/script/update_rubygems_and_install_bundler index 558923ac85..e7032a529b 100755 --- a/script/update_rubygems_and_install_bundler +++ b/script/update_rubygems_and_install_bundler @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2020-11-22T07:41:13+00:00 from the rspec-dev repo. +# This file was generated on 2020-12-08T21:16:12+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e From 87e7eac74c64cae455a3bba64075be19eb01ce89 Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Wed, 9 Dec 2020 08:28:47 +0000 Subject: [PATCH 024/104] Updated ci build scripts (from rspec-dev) --- .github/workflows/ci.yml | 4 ++-- .rubocop_rspec_base.yml | 2 +- .travis.yml | 2 +- script/ci_functions.sh | 2 +- script/clone_all_rspec_repos | 2 +- script/functions.sh | 7 ++----- script/predicate_functions.sh | 2 +- script/run_build | 2 +- script/update_rubygems_and_install_bundler | 2 +- 9 files changed, 11 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 682f9d5224..c9b63b2fc6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -# This file was generated on 2020-12-08T21:16:12+00:00 from the rspec-dev repo. +# This file was generated on 2020-12-09T08:28:47+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. name: RSpec CI @@ -18,7 +18,7 @@ jobs: strategy: matrix: ruby: - - 3.0.0-preview1 + - 3.0.0-preview2 - 2.7 - 2.6 - 2.5 diff --git a/.rubocop_rspec_base.yml b/.rubocop_rspec_base.yml index 4964eed88a..bd8805481c 100644 --- a/.rubocop_rspec_base.yml +++ b/.rubocop_rspec_base.yml @@ -1,4 +1,4 @@ -# This file was generated on 2020-12-08T21:16:12+00:00 from the rspec-dev repo. +# This file was generated on 2020-12-09T08:28:47+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. # This file contains defaults for RSpec projects. Individual projects diff --git a/.travis.yml b/.travis.yml index 55bd920f36..b4fd0ce548 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ -# This file was generated on 2020-12-08T21:16:12+00:00 from the rspec-dev repo. +# This file was generated on 2020-12-09T08:28:47+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. # In order to install old Rubies, we need to use old Ubuntu distibution. diff --git a/script/ci_functions.sh b/script/ci_functions.sh index 5dae99c375..16f77117ac 100644 --- a/script/ci_functions.sh +++ b/script/ci_functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2020-12-08T21:16:12+00:00 from the rspec-dev repo. +# This file was generated on 2020-12-09T08:28:47+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. # Taken from: diff --git a/script/clone_all_rspec_repos b/script/clone_all_rspec_repos index d2465fcbe1..98016e7043 100755 --- a/script/clone_all_rspec_repos +++ b/script/clone_all_rspec_repos @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2020-12-08T21:16:12+00:00 from the rspec-dev repo. +# This file was generated on 2020-12-09T08:28:47+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e diff --git a/script/functions.sh b/script/functions.sh index c1734a2103..5fa16ff958 100644 --- a/script/functions.sh +++ b/script/functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2020-12-08T21:16:12+00:00 from the rspec-dev repo. +# This file was generated on 2020-12-09T08:28:47+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" @@ -88,10 +88,7 @@ function run_spec_suite_for { echo "Running specs for $1" pushd ../$1 unset BUNDLE_GEMFILE - bundle_install_flags="" - if [ -e .travis.yml ]; then - bundle_install_flags=`cat .travis.yml | grep bundler_args | tr -d '"' | grep -o " .*"` - fi + bundle_install_flags=`cat .github/workflows/ci.yml | grep "bundle install" | sed 's/.* bundle install//'` travis_retry eval "(unset RUBYOPT; exec bundle install $bundle_install_flags)" run_specs_and_record_done popd diff --git a/script/predicate_functions.sh b/script/predicate_functions.sh index f1876d05f2..d9e7d2b9a6 100644 --- a/script/predicate_functions.sh +++ b/script/predicate_functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2020-12-08T21:16:12+00:00 from the rspec-dev repo. +# This file was generated on 2020-12-09T08:28:47+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. function is_mri { diff --git a/script/run_build b/script/run_build index f5682141df..919697fa91 100755 --- a/script/run_build +++ b/script/run_build @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2020-12-08T21:16:12+00:00 from the rspec-dev repo. +# This file was generated on 2020-12-09T08:28:47+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e diff --git a/script/update_rubygems_and_install_bundler b/script/update_rubygems_and_install_bundler index e7032a529b..d3d9f5d7f9 100755 --- a/script/update_rubygems_and_install_bundler +++ b/script/update_rubygems_and_install_bundler @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2020-12-08T21:16:12+00:00 from the rspec-dev repo. +# This file was generated on 2020-12-09T08:28:47+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e From 2669cfe61f74a510843ac41f6cf2e3ea273f7674 Mon Sep 17 00:00:00 2001 From: Phil Pirozhkov Date: Tue, 15 Dec 2020 18:21:42 +0300 Subject: [PATCH 025/104] Fix deprecation message expectation in spec --- spec/rspec/core/formatters_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/rspec/core/formatters_spec.rb b/spec/rspec/core/formatters_spec.rb index 3436d2500c..06c9bb664e 100644 --- a/spec/rspec/core/formatters_spec.rb +++ b/spec/rspec/core/formatters_spec.rb @@ -83,8 +83,8 @@ module RSpec::Core::Formatters end it "issues a deprecation" do - expect_warn_deprecation_with_call_site(__FILE__, __LINE__ + 2, - /The #{formatter_class} formatter uses the deprecated formatter interface/) + expect_warn_deprecation( + /The #{formatter_class} formatter uses the deprecated formatter interface.+#{__FILE__}:#{__LINE__ + 1}/) loader.add formatter_class, output end end From 658ff6575d4874fbfa95a03f641ea89d636d1f56 Mon Sep 17 00:00:00 2001 From: Benoit Tigeot Date: Mon, 21 Dec 2020 20:42:54 +0100 Subject: [PATCH 026/104] Updated ci build scripts (from rspec-dev) --- .github/workflows/ci.yml | 4 ++-- .rubocop_rspec_base.yml | 2 +- .travis.yml | 2 +- script/ci_functions.sh | 2 +- script/clone_all_rspec_repos | 2 +- script/functions.sh | 2 +- script/predicate_functions.sh | 2 +- script/run_build | 2 +- script/update_rubygems_and_install_bundler | 2 +- 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c9b63b2fc6..efbd618bcd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -# This file was generated on 2020-12-09T08:28:47+00:00 from the rspec-dev repo. +# This file was generated on 2020-12-21T20:42:54+01:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. name: RSpec CI @@ -18,7 +18,7 @@ jobs: strategy: matrix: ruby: - - 3.0.0-preview2 + - 3.0.0-rc1 - 2.7 - 2.6 - 2.5 diff --git a/.rubocop_rspec_base.yml b/.rubocop_rspec_base.yml index bd8805481c..d71037c3ba 100644 --- a/.rubocop_rspec_base.yml +++ b/.rubocop_rspec_base.yml @@ -1,4 +1,4 @@ -# This file was generated on 2020-12-09T08:28:47+00:00 from the rspec-dev repo. +# This file was generated on 2020-12-21T20:42:54+01:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. # This file contains defaults for RSpec projects. Individual projects diff --git a/.travis.yml b/.travis.yml index b4fd0ce548..05d87b0bde 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ -# This file was generated on 2020-12-09T08:28:47+00:00 from the rspec-dev repo. +# This file was generated on 2020-12-21T20:42:54+01:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. # In order to install old Rubies, we need to use old Ubuntu distibution. diff --git a/script/ci_functions.sh b/script/ci_functions.sh index 16f77117ac..3b1c850a0c 100644 --- a/script/ci_functions.sh +++ b/script/ci_functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2020-12-09T08:28:47+00:00 from the rspec-dev repo. +# This file was generated on 2020-12-21T20:42:54+01:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. # Taken from: diff --git a/script/clone_all_rspec_repos b/script/clone_all_rspec_repos index 98016e7043..cc1e5479b1 100755 --- a/script/clone_all_rspec_repos +++ b/script/clone_all_rspec_repos @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2020-12-09T08:28:47+00:00 from the rspec-dev repo. +# This file was generated on 2020-12-21T20:42:54+01:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e diff --git a/script/functions.sh b/script/functions.sh index 5fa16ff958..6b4bae44ba 100644 --- a/script/functions.sh +++ b/script/functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2020-12-09T08:28:47+00:00 from the rspec-dev repo. +# This file was generated on 2020-12-21T20:42:54+01:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" diff --git a/script/predicate_functions.sh b/script/predicate_functions.sh index d9e7d2b9a6..971dab22da 100644 --- a/script/predicate_functions.sh +++ b/script/predicate_functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2020-12-09T08:28:47+00:00 from the rspec-dev repo. +# This file was generated on 2020-12-21T20:42:54+01:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. function is_mri { diff --git a/script/run_build b/script/run_build index 919697fa91..40fa984b74 100755 --- a/script/run_build +++ b/script/run_build @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2020-12-09T08:28:47+00:00 from the rspec-dev repo. +# This file was generated on 2020-12-21T20:42:54+01:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e diff --git a/script/update_rubygems_and_install_bundler b/script/update_rubygems_and_install_bundler index d3d9f5d7f9..b1ff0b54b5 100755 --- a/script/update_rubygems_and_install_bundler +++ b/script/update_rubygems_and_install_bundler @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2020-12-09T08:28:47+00:00 from the rspec-dev repo. +# This file was generated on 2020-12-21T20:42:54+01:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e From 9e1b73ece81a5275895c7eaaf8f7cab8b76e7ed3 Mon Sep 17 00:00:00 2001 From: Benoit Tigeot Date: Mon, 21 Dec 2020 22:20:32 +0100 Subject: [PATCH 027/104] Instance vars no longer emit warnings in Ruby 3 Related: https://github.com/ruby/ruby/commit/01b7d5acc702df22d306ae95f1a9c3096e63e624 --- features/command_line/warnings_option.feature | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/features/command_line/warnings_option.feature b/features/command_line/warnings_option.feature index ab695074db..7c22e9cf69 100644 --- a/features/command_line/warnings_option.feature +++ b/features/command_line/warnings_option.feature @@ -8,7 +8,7 @@ Feature: `--warnings` option (run with warnings enabled) """ruby RSpec.describe do it 'generates warning' do - @undefined + $undefined end end """ @@ -21,7 +21,7 @@ Feature: `--warnings` option (run with warnings enabled) """ruby RSpec.describe do it 'generates warning' do - @undefined + $undefined end end """ From 4c5631cdbe94416d5143971891dcc543b0848e38 Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Tue, 22 Dec 2020 08:25:54 +0000 Subject: [PATCH 028/104] Updated ci build scripts (from rspec-dev)main- --- .github/workflows/ci.yml | 6 +++++- .rubocop_rspec_base.yml | 2 +- .travis.yml | 2 +- script/ci_functions.sh | 2 +- script/clone_all_rspec_repos | 2 +- script/functions.sh | 2 +- script/predicate_functions.sh | 2 +- script/run_build | 2 +- script/update_rubygems_and_install_bundler | 2 +- 9 files changed, 13 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index efbd618bcd..6134533c7a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -# This file was generated on 2020-12-21T20:42:54+01:00 from the rspec-dev repo. +# This file was generated on 2020-12-22T08:25:54+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. name: RSpec CI @@ -11,6 +11,10 @@ on: pull_request: branches: - '*' +env: + RSPEC_CI: true + # This tells rspec-rails what branch to run in ci + RSPEC_VERSION: '= 3.11.0.pre' jobs: test: name: Ruby ${{ matrix.ruby }} ${{ matrix.name_extra || '' }} diff --git a/.rubocop_rspec_base.yml b/.rubocop_rspec_base.yml index d71037c3ba..3b2de16914 100644 --- a/.rubocop_rspec_base.yml +++ b/.rubocop_rspec_base.yml @@ -1,4 +1,4 @@ -# This file was generated on 2020-12-21T20:42:54+01:00 from the rspec-dev repo. +# This file was generated on 2020-12-22T08:25:54+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. # This file contains defaults for RSpec projects. Individual projects diff --git a/.travis.yml b/.travis.yml index 05d87b0bde..65aa18c883 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ -# This file was generated on 2020-12-21T20:42:54+01:00 from the rspec-dev repo. +# This file was generated on 2020-12-22T08:25:54+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. # In order to install old Rubies, we need to use old Ubuntu distibution. diff --git a/script/ci_functions.sh b/script/ci_functions.sh index 3b1c850a0c..dc84dbf326 100644 --- a/script/ci_functions.sh +++ b/script/ci_functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2020-12-21T20:42:54+01:00 from the rspec-dev repo. +# This file was generated on 2020-12-22T08:25:54+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. # Taken from: diff --git a/script/clone_all_rspec_repos b/script/clone_all_rspec_repos index cc1e5479b1..9eeadcad24 100755 --- a/script/clone_all_rspec_repos +++ b/script/clone_all_rspec_repos @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2020-12-21T20:42:54+01:00 from the rspec-dev repo. +# This file was generated on 2020-12-22T08:25:54+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e diff --git a/script/functions.sh b/script/functions.sh index 6b4bae44ba..e35b085dcb 100644 --- a/script/functions.sh +++ b/script/functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2020-12-21T20:42:54+01:00 from the rspec-dev repo. +# This file was generated on 2020-12-22T08:25:54+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" diff --git a/script/predicate_functions.sh b/script/predicate_functions.sh index 971dab22da..f3ad8a2dec 100644 --- a/script/predicate_functions.sh +++ b/script/predicate_functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2020-12-21T20:42:54+01:00 from the rspec-dev repo. +# This file was generated on 2020-12-22T08:25:54+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. function is_mri { diff --git a/script/run_build b/script/run_build index 40fa984b74..6588baa2ee 100755 --- a/script/run_build +++ b/script/run_build @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2020-12-21T20:42:54+01:00 from the rspec-dev repo. +# This file was generated on 2020-12-22T08:25:54+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e diff --git a/script/update_rubygems_and_install_bundler b/script/update_rubygems_and_install_bundler index b1ff0b54b5..2d6c94bd85 100755 --- a/script/update_rubygems_and_install_bundler +++ b/script/update_rubygems_and_install_bundler @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2020-12-21T20:42:54+01:00 from the rspec-dev repo. +# This file was generated on 2020-12-22T08:25:54+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e From 77b4a9667ee6925d125e763c986d0651551512b7 Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Tue, 22 Dec 2020 17:41:07 +0000 Subject: [PATCH 029/104] Enable warning support explicitly --- features/command_line/warnings_option.feature | 17 +++++++++++++++++ features/support/ruby_27_support.rb | 7 +++++++ lib/rspec/core/option_parser.rb | 3 +++ 3 files changed, 27 insertions(+) create mode 100644 features/support/ruby_27_support.rb diff --git a/features/command_line/warnings_option.feature b/features/command_line/warnings_option.feature index ab695074db..6d50c23ade 100644 --- a/features/command_line/warnings_option.feature +++ b/features/command_line/warnings_option.feature @@ -15,6 +15,23 @@ Feature: `--warnings` option (run with warnings enabled) When I run `rspec --warnings example_spec.rb` Then the output should contain "warning" + @ruby-2-7 + Scenario: + Given a file named "example_spec.rb" with: + """ruby + def foo(**kwargs) + kwargs + end + + RSpec.describe do + it "should warn about keyword arguments with 'rspec -w'" do + expect(foo({a: 1})).to eq({a: 1}) + end + end + """ + When I run `rspec -w example_spec.rb` + Then the output should contain "warning" + @unsupported-on-rbx Scenario: Given a file named "example_spec.rb" with: diff --git a/features/support/ruby_27_support.rb b/features/support/ruby_27_support.rb new file mode 100644 index 0000000000..b44e89c69b --- /dev/null +++ b/features/support/ruby_27_support.rb @@ -0,0 +1,7 @@ +Around "@ruby-2-7" do |scenario, block| + if RUBY_VERSION.to_f == 2.7 + block.call + else + warn "Skipping scenario #{scenario.title} on Ruby v#{RUBY_VERSION}" + end +end diff --git a/lib/rspec/core/option_parser.rb b/lib/rspec/core/option_parser.rb index c962374510..7c27dcbed5 100644 --- a/lib/rspec/core/option_parser.rb +++ b/lib/rspec/core/option_parser.rb @@ -184,6 +184,9 @@ def parser(options) end parser.on('-w', '--warnings', 'Enable ruby warnings') do + if Object.const_defined?(:Warning) && Warning.respond_to?(:[]=) + Warning[:deprecated] = true + end $VERBOSE = true end From 26a8ac8efe45199a6477203fbec06922605f5bb0 Mon Sep 17 00:00:00 2001 From: Benoit Tigeot Date: Thu, 24 Dec 2020 13:24:00 +0100 Subject: [PATCH 030/104] Updated common plaintext files (from rspec-dev)main- --- .github/FUNDING.yml | 4 ++-- BUILD_DETAIL.md | 2 +- CODE_OF_CONDUCT.md | 2 +- CONTRIBUTING.md | 44 +++++++++++++++++++++++++++++++++++++++++++- DEVELOPMENT.md | 2 +- REPORT_TEMPLATE.md | 2 +- 6 files changed, 49 insertions(+), 7 deletions(-) diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 4fb398d245..8f99b82b6c 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,5 +1,5 @@ -# This file was generated on 2019-12-05T21:32:23+00:00 from the rspec-dev repo. +# This file was generated on 2020-12-24T13:24:00+01:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. -github: [JonRowe] +github: [JonRowe, benoittgt] open_collective: rspec diff --git a/BUILD_DETAIL.md b/BUILD_DETAIL.md index 28f7616ae4..f975e5d4c1 100644 --- a/BUILD_DETAIL.md +++ b/BUILD_DETAIL.md @@ -1,5 +1,5 @@ diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 618d788d33..43d378d156 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1,5 +1,5 @@ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 63f5202cff..5834dc8ed5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,5 +1,5 @@ @@ -42,3 +42,45 @@ test case. To make this process easier, we have prepared one basic Maintenance branches are how we manage the different supported point releases of RSpec. As such, while they might look like good candidates to merge into main, please do not open pull requests to merge them. + +## Working on multiple RSpec gems at the same time + +RSpec is composed of multiple gems (`rspec-core`, `rspec-mocks`, etc). Sometimes you have +to work on a combination of them at the same time. When submitting your code for review, +we ask that you get a passing build (green CI). If you are working across the repositories, +please add a commit that temporarily pins your PR to the right branch of the other repository +you depend on. For example, if we wanted a change in `rspec-expectations` that relied on a +change for on `rspec-mocks`. We add a commit with the title: + +>[WIP] Use rspec-mocks with "custom-failure-message" branch + +And content: + +```diff +diff --git a/Gemfile b/Gemfile + +-%w[rspec rspec-core rspec-mocks rspec-support].each do |lib| ++%w[rspec rspec-core rspec-support].each do |lib| + library_path = File.expand_path("../../#{lib}", __FILE__) + if File.exist?(library_path) && !ENV['USE_GIT_REPOS'] + gem lib, :path => library_path +@@ -11,6 +11,7 @@ branch = File.read(File.expand_path("../maintenance-branch", __FILE__)).chomp + gem lib, :git => "https://github.com/rspec/#{lib}.git", :branch => branch + end + end ++gem 'rspec-mocks', :git => "https://github.com/rspec/rspec-mocks.git", :branch => "custom-failure-message" +``` + +In general the process is: +1. Create PRs explaining what you are trying to achieve. +2. Pin the repositories to each other. +3. Check they pass (go green). +4. Await review if appropriate. +5. Remove the commit from step 2. We will merge ignoring the failure. +6. Remove the commit from the other, check it passes with the other commit now on `main`. +7. Merge the other. +8. We will trigger builds for the `main` branch of affected repositories to check if everything is in order. + +Steps 5-8 should happen continuously (e.g. one after another but within a short timespan) +so that we don't leave a broken main around. It is important to triage that build process +and revert if necessary. diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 8d6b91d39a..3c64392fe6 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -1,5 +1,5 @@ diff --git a/REPORT_TEMPLATE.md b/REPORT_TEMPLATE.md index b569e8aaf7..1a96b4ab70 100644 --- a/REPORT_TEMPLATE.md +++ b/REPORT_TEMPLATE.md @@ -1,5 +1,5 @@ From 7c8b0fff3f918bc4a5efef6a52d83a6c53f1286e Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Fri, 25 Dec 2020 18:48:30 +0000 Subject: [PATCH 031/104] Updated common plaintext files (from rspec-dev)main --- .github/FUNDING.yml | 2 +- BUILD_DETAIL.md | 16 ++++++++-------- CODE_OF_CONDUCT.md | 2 +- CONTRIBUTING.md | 2 +- DEVELOPMENT.md | 5 ++--- REPORT_TEMPLATE.md | 2 +- 6 files changed, 14 insertions(+), 15 deletions(-) diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 8f99b82b6c..d3a58b2083 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,4 +1,4 @@ -# This file was generated on 2020-12-24T13:24:00+01:00 from the rspec-dev repo. +# This file was generated on 2020-12-25T18:48:30+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. github: [JonRowe, benoittgt] diff --git a/BUILD_DETAIL.md b/BUILD_DETAIL.md index f975e5d4c1..dfda42849f 100644 --- a/BUILD_DETAIL.md +++ b/BUILD_DETAIL.md @@ -1,5 +1,5 @@ @@ -97,10 +97,11 @@ $ bundle exec yard doc --no-cache $ bin/yard doc --no-cache ``` -## Rubocop +## RuboCop -We use [Rubocop](https://github.com/bbatsov/rubocop) to enforce style conventions on the project so -that the code has stylistic consistency throughout. Run with: +We use [RuboCop](https://github.com/rubocop-hq/rubocop) to enforce style +conventions on the project so that the code has stylistic consistency +throughout. Run with: ``` $ bundle exec rubocop lib @@ -110,9 +111,9 @@ $ bundle exec rubocop lib $ bin/rubocop lib ``` -Our Rubocop configuration is a work-in-progress, so if you get a failure -due to a Rubocop default, feel free to ask about changing the -configuration. Otherwise, you'll need to address the Rubocop failure, +Our RuboCop configuration is a work-in-progress, so if you get a failure +due to a RuboCop default, feel free to ask about changing the +configuration. Otherwise, you'll need to address the RuboCop failure, or, as a measure of last resort, by wrapping the offending code in comments like `# rubocop:disable SomeCheck` and `# rubocop:enable SomeCheck`. @@ -146,4 +147,3 @@ build for another repo, so our CI build includes a spec that runs the spec suite of each of the _other_ project repos. Note that we only run the spec suite, not the full build, of the other projects, as the spec suite runs very quickly compared to the full build. - diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 43d378d156..b6be7666ce 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1,5 +1,5 @@ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5834dc8ed5..feb34b3613 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,5 +1,5 @@ diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 3c64392fe6..092d8fd548 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -1,5 +1,5 @@ @@ -108,7 +108,7 @@ Here's a short, non-exhaustive checklist of things we typically ask contributors - [ ] New behavior is covered by tests and all tests are passing. - [ ] No Ruby warnings are issued by your changes. - [ ] Documentation reflects changes and renders as intended. -- [ ] Rubocop passes (e.g. `bundle exec rubocop lib`). +- [ ] RuboCop passes (e.g. `bundle exec rubocop lib`). - [ ] Commits are squashed into a reasonable number of logical changesets that tell an easy-to-follow story. - [ ] No changelog entry is necessary (we'll add it as part of the merge process!) @@ -129,4 +129,3 @@ $ bin/yard server --reload ``` Then navigate to `localhost:8808` to view the rendered docs. - diff --git a/REPORT_TEMPLATE.md b/REPORT_TEMPLATE.md index 1a96b4ab70..94f9852e50 100644 --- a/REPORT_TEMPLATE.md +++ b/REPORT_TEMPLATE.md @@ -1,5 +1,5 @@ From 47b7608885a1c0a51ce9bfe30123a5913258d62a Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Fri, 25 Dec 2020 21:54:20 +0000 Subject: [PATCH 032/104] Changelog for #2778 --- Changelog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Changelog.md b/Changelog.md index 8096fb125f..d367237494 100644 --- a/Changelog.md +++ b/Changelog.md @@ -3,6 +3,7 @@ Enhancements: * Improve pluralisation of words ending with `s` (like process). (Joshua Pinter, #2779) +* Add ordering by file modification time (most recent first). (Matheus Richard, #2778) ### 3.10.0 / 2020-10-30 [Full Changelog](http://github.com/rspec/rspec-core/compare/v3.9.3...v3.10.0) From 8168e1e0b4d2c454e462e35e7f46ce17ebc7eb6f Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Sat, 26 Dec 2020 10:45:27 +0000 Subject: [PATCH 033/104] Updated ci build scripts (from rspec-dev)main --- .github/workflows/ci.yml | 6 ++++-- .rubocop_rspec_base.yml | 2 +- .travis.yml | 2 +- script/ci_functions.sh | 2 +- script/clone_all_rspec_repos | 2 +- script/functions.sh | 2 +- script/predicate_functions.sh | 24 +++++++++++++++++++++- script/run_build | 4 ++-- script/update_rubygems_and_install_bundler | 2 +- 9 files changed, 35 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6134533c7a..8060dd7906 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -# This file was generated on 2020-12-22T08:25:54+00:00 from the rspec-dev repo. +# This file was generated on 2020-12-26T10:45:27+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. name: RSpec CI @@ -30,11 +30,13 @@ jobs: - 2.3 - 2.2 - 2.1.9 - - ruby-head env: - DIFF_LCS_VERSION: "> 1.4.3" include: + - ruby: ruby-head + env: + RUBY_HEAD: true - ruby: jruby-9.2.13.0 env: JRUBY_OPTS: "--dev" diff --git a/.rubocop_rspec_base.yml b/.rubocop_rspec_base.yml index 3b2de16914..ad338337da 100644 --- a/.rubocop_rspec_base.yml +++ b/.rubocop_rspec_base.yml @@ -1,4 +1,4 @@ -# This file was generated on 2020-12-22T08:25:54+00:00 from the rspec-dev repo. +# This file was generated on 2020-12-26T10:45:27+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. # This file contains defaults for RSpec projects. Individual projects diff --git a/.travis.yml b/.travis.yml index 65aa18c883..8924a4ba23 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ -# This file was generated on 2020-12-22T08:25:54+00:00 from the rspec-dev repo. +# This file was generated on 2020-12-26T10:45:27+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. # In order to install old Rubies, we need to use old Ubuntu distibution. diff --git a/script/ci_functions.sh b/script/ci_functions.sh index dc84dbf326..7799544c14 100644 --- a/script/ci_functions.sh +++ b/script/ci_functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2020-12-22T08:25:54+00:00 from the rspec-dev repo. +# This file was generated on 2020-12-26T10:45:27+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. # Taken from: diff --git a/script/clone_all_rspec_repos b/script/clone_all_rspec_repos index 9eeadcad24..8e8119e864 100755 --- a/script/clone_all_rspec_repos +++ b/script/clone_all_rspec_repos @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2020-12-22T08:25:54+00:00 from the rspec-dev repo. +# This file was generated on 2020-12-26T10:45:27+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e diff --git a/script/functions.sh b/script/functions.sh index e35b085dcb..15452025fe 100644 --- a/script/functions.sh +++ b/script/functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2020-12-22T08:25:54+00:00 from the rspec-dev repo. +# This file was generated on 2020-12-26T10:45:27+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" diff --git a/script/predicate_functions.sh b/script/predicate_functions.sh index f3ad8a2dec..e08e07b888 100644 --- a/script/predicate_functions.sh +++ b/script/predicate_functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2020-12-22T08:25:54+00:00 from the rspec-dev repo. +# This file was generated on 2020-12-26T10:45:27+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. function is_mri { @@ -11,6 +11,28 @@ function is_mri { fi; } +function is_ruby_head { + # This checks for the presence of our CI's ruby-head env variable + if [ -z ${RUBY_HEAD+x} ]; then + return 1 + else + return 0 + fi; +} + +function supports_cross_build_checks { + if is_mri; then + # We don't run cross build checks on ruby-head + if is_ruby_head; then + return 1 + else + return 0 + fi + else + return 1 + fi +} + function is_jruby { if ruby -e "exit(defined?(RUBY_PLATFORM) && RUBY_PLATFORM == 'java')"; then # RUBY_ENGINE only returns 'ruby' on MRI. diff --git a/script/run_build b/script/run_build index 6588baa2ee..979ac19802 100755 --- a/script/run_build +++ b/script/run_build @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2020-12-22T08:25:54+00:00 from the rspec-dev repo. +# This file was generated on 2020-12-26T10:45:27+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e @@ -28,7 +28,7 @@ if style_and_lint_enforced; then fold "rubocop" check_style_and_lint fi -if is_mri; then +if supports_cross_build_checks; then fold "one-by-one specs" run_specs_one_by_one run_all_spec_suites else diff --git a/script/update_rubygems_and_install_bundler b/script/update_rubygems_and_install_bundler index 2d6c94bd85..48b59e7cca 100755 --- a/script/update_rubygems_and_install_bundler +++ b/script/update_rubygems_and_install_bundler @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2020-12-22T08:25:54+00:00 from the rspec-dev repo. +# This file was generated on 2020-12-26T10:45:27+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e From 046ab7108d5d3196a18d690767f81d15820f3f10 Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Sun, 27 Dec 2020 10:37:01 +0000 Subject: [PATCH 034/104] Updated ci build scripts (from rspec-dev)main --- .github/workflows/ci.yml | 4 ++-- .rubocop_rspec_base.yml | 2 +- .travis.yml | 2 +- script/ci_functions.sh | 2 +- script/clone_all_rspec_repos | 2 +- script/functions.sh | 2 +- script/predicate_functions.sh | 2 +- script/run_build | 2 +- script/update_rubygems_and_install_bundler | 2 +- 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8060dd7906..c454aa43de 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -# This file was generated on 2020-12-26T10:45:27+00:00 from the rspec-dev repo. +# This file was generated on 2020-12-27T10:37:01+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. name: RSpec CI @@ -22,7 +22,7 @@ jobs: strategy: matrix: ruby: - - 3.0.0-rc1 + - 3.0 - 2.7 - 2.6 - 2.5 diff --git a/.rubocop_rspec_base.yml b/.rubocop_rspec_base.yml index ad338337da..c61eb27a63 100644 --- a/.rubocop_rspec_base.yml +++ b/.rubocop_rspec_base.yml @@ -1,4 +1,4 @@ -# This file was generated on 2020-12-26T10:45:27+00:00 from the rspec-dev repo. +# This file was generated on 2020-12-27T10:37:01+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. # This file contains defaults for RSpec projects. Individual projects diff --git a/.travis.yml b/.travis.yml index 8924a4ba23..7bbaa7e2ff 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ -# This file was generated on 2020-12-26T10:45:27+00:00 from the rspec-dev repo. +# This file was generated on 2020-12-27T10:37:01+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. # In order to install old Rubies, we need to use old Ubuntu distibution. diff --git a/script/ci_functions.sh b/script/ci_functions.sh index 7799544c14..4e883b9564 100644 --- a/script/ci_functions.sh +++ b/script/ci_functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2020-12-26T10:45:27+00:00 from the rspec-dev repo. +# This file was generated on 2020-12-27T10:37:01+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. # Taken from: diff --git a/script/clone_all_rspec_repos b/script/clone_all_rspec_repos index 8e8119e864..2eb3e2f5f1 100755 --- a/script/clone_all_rspec_repos +++ b/script/clone_all_rspec_repos @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2020-12-26T10:45:27+00:00 from the rspec-dev repo. +# This file was generated on 2020-12-27T10:37:01+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e diff --git a/script/functions.sh b/script/functions.sh index 15452025fe..9eebb5933c 100644 --- a/script/functions.sh +++ b/script/functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2020-12-26T10:45:27+00:00 from the rspec-dev repo. +# This file was generated on 2020-12-27T10:37:01+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" diff --git a/script/predicate_functions.sh b/script/predicate_functions.sh index e08e07b888..cc360bee31 100644 --- a/script/predicate_functions.sh +++ b/script/predicate_functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2020-12-26T10:45:27+00:00 from the rspec-dev repo. +# This file was generated on 2020-12-27T10:37:01+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. function is_mri { diff --git a/script/run_build b/script/run_build index 979ac19802..b1d9e73d86 100755 --- a/script/run_build +++ b/script/run_build @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2020-12-26T10:45:27+00:00 from the rspec-dev repo. +# This file was generated on 2020-12-27T10:37:01+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e diff --git a/script/update_rubygems_and_install_bundler b/script/update_rubygems_and_install_bundler index 48b59e7cca..b3b0e6f3a7 100755 --- a/script/update_rubygems_and_install_bundler +++ b/script/update_rubygems_and_install_bundler @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2020-12-26T10:45:27+00:00 from the rspec-dev repo. +# This file was generated on 2020-12-27T10:37:01+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e From ca771aafed6a1dfaa6303f5b30f105353bbdf772 Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Tue, 22 Dec 2020 21:33:56 +0000 Subject: [PATCH 035/104] Change log for #2811 --- Changelog.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Changelog.md b/Changelog.md index d367237494..63ffa1013f 100644 --- a/Changelog.md +++ b/Changelog.md @@ -5,6 +5,11 @@ Enhancements: * Improve pluralisation of words ending with `s` (like process). (Joshua Pinter, #2779) * Add ordering by file modification time (most recent first). (Matheus Richard, #2778) +Bug fixes: + +* RSpec warning output was missing deprecations from Ruby, these are now included. + (Jon Rowe, #2811) + ### 3.10.0 / 2020-10-30 [Full Changelog](http://github.com/rspec/rspec-core/compare/v3.9.3...v3.10.0) From 3ad94adfb2f6867b5f0ebe8d72d06db4ed77904e Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Sun, 27 Dec 2020 14:32:17 +0000 Subject: [PATCH 036/104] Updated ci build scripts (from rspec-dev)main --- .github/workflows/ci.yml | 2 +- .rubocop_rspec_base.yml | 2 +- .travis.yml | 2 +- script/ci_functions.sh | 2 +- script/clone_all_rspec_repos | 2 +- script/functions.sh | 10 +++++----- script/predicate_functions.sh | 2 +- script/run_build | 2 +- script/update_rubygems_and_install_bundler | 2 +- 9 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c454aa43de..b0d5bdab25 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -# This file was generated on 2020-12-27T10:37:01+00:00 from the rspec-dev repo. +# This file was generated on 2020-12-27T14:32:17+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. name: RSpec CI diff --git a/.rubocop_rspec_base.yml b/.rubocop_rspec_base.yml index c61eb27a63..2cce0bc633 100644 --- a/.rubocop_rspec_base.yml +++ b/.rubocop_rspec_base.yml @@ -1,4 +1,4 @@ -# This file was generated on 2020-12-27T10:37:01+00:00 from the rspec-dev repo. +# This file was generated on 2020-12-27T14:32:17+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. # This file contains defaults for RSpec projects. Individual projects diff --git a/.travis.yml b/.travis.yml index 7bbaa7e2ff..18e252ee74 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ -# This file was generated on 2020-12-27T10:37:01+00:00 from the rspec-dev repo. +# This file was generated on 2020-12-27T14:32:17+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. # In order to install old Rubies, we need to use old Ubuntu distibution. diff --git a/script/ci_functions.sh b/script/ci_functions.sh index 4e883b9564..1aab4ea362 100644 --- a/script/ci_functions.sh +++ b/script/ci_functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2020-12-27T10:37:01+00:00 from the rspec-dev repo. +# This file was generated on 2020-12-27T14:32:17+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. # Taken from: diff --git a/script/clone_all_rspec_repos b/script/clone_all_rspec_repos index 2eb3e2f5f1..de5b3ad501 100755 --- a/script/clone_all_rspec_repos +++ b/script/clone_all_rspec_repos @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2020-12-27T10:37:01+00:00 from the rspec-dev repo. +# This file was generated on 2020-12-27T14:32:17+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e diff --git a/script/functions.sh b/script/functions.sh index 9eebb5933c..9c7abe2d0b 100644 --- a/script/functions.sh +++ b/script/functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2020-12-27T10:37:01+00:00 from the rspec-dev repo. +# This file was generated on 2020-12-27T14:32:17+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" @@ -20,12 +20,12 @@ fi function clone_repo { if [ ! -d $1 ]; then # don't clone if the dir is already there if [ -z "$2" ]; then - BRANCH_TO_CLONE="$MAINTENANCE_BRANCH" + BRANCH_TO_CLONE="${MAINTENANCE_BRANCH?}"; else - BRANCH_TO_CLONE="$2" - fi + BRANCH_TO_CLONE="$2"; + fi; - travis_retry eval "git clone https://github.com/rspec/$1 --depth 1 --branch $BRANCH_TO_CLONE" + travis_retry eval "git clone https://github.com/rspec/$1 --depth 1 --branch ${BRANCH_TO_CLONE?}" fi; } diff --git a/script/predicate_functions.sh b/script/predicate_functions.sh index cc360bee31..2b79d88160 100644 --- a/script/predicate_functions.sh +++ b/script/predicate_functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2020-12-27T10:37:01+00:00 from the rspec-dev repo. +# This file was generated on 2020-12-27T14:32:17+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. function is_mri { diff --git a/script/run_build b/script/run_build index b1d9e73d86..c1fba76c7c 100755 --- a/script/run_build +++ b/script/run_build @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2020-12-27T10:37:01+00:00 from the rspec-dev repo. +# This file was generated on 2020-12-27T14:32:17+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e diff --git a/script/update_rubygems_and_install_bundler b/script/update_rubygems_and_install_bundler index b3b0e6f3a7..291b60c3d0 100755 --- a/script/update_rubygems_and_install_bundler +++ b/script/update_rubygems_and_install_bundler @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2020-12-27T10:37:01+00:00 from the rspec-dev repo. +# This file was generated on 2020-12-27T14:32:17+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e From 2f3a3c90d475c9e448275ad5ea38dfb04a035c49 Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Sun, 27 Dec 2020 14:42:33 +0000 Subject: [PATCH 037/104] v3.10.1 --- Changelog.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Changelog.md b/Changelog.md index 63ffa1013f..51df39ce09 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,10 +1,14 @@ ### Development +[Full Changelog](http://github.com/rspec/rspec-core/compare/v3.10.1...main) Enhancements: * Improve pluralisation of words ending with `s` (like process). (Joshua Pinter, #2779) * Add ordering by file modification time (most recent first). (Matheus Richard, #2778) +### 3.10.1 / 2020-12-27 +[Full Changelog](http://github.com/rspec/rspec-core/compare/v3.10.0...v3.10.1) + Bug fixes: * RSpec warning output was missing deprecations from Ruby, these are now included. From e3d9b34892ace0b321587a6a672f41d0765af39a Mon Sep 17 00:00:00 2001 From: Phil Pirozhkov Date: Thu, 31 Dec 2020 00:41:34 +0300 Subject: [PATCH 038/104] Updated ci build scripts (from rspec-dev)main --- .github/workflows/ci.yml | 2 +- .rubocop_rspec_base.yml | 2 +- .travis.yml | 2 +- script/ci_functions.sh | 2 +- script/clone_all_rspec_repos | 2 +- script/functions.sh | 2 +- script/predicate_functions.sh | 2 +- script/run_build | 3 ++- script/update_rubygems_and_install_bundler | 2 +- 9 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b0d5bdab25..e426ca0232 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -# This file was generated on 2020-12-27T14:32:17+00:00 from the rspec-dev repo. +# This file was generated on 2020-12-31T00:41:34+03:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. name: RSpec CI diff --git a/.rubocop_rspec_base.yml b/.rubocop_rspec_base.yml index 2cce0bc633..e7dae7a41a 100644 --- a/.rubocop_rspec_base.yml +++ b/.rubocop_rspec_base.yml @@ -1,4 +1,4 @@ -# This file was generated on 2020-12-27T14:32:17+00:00 from the rspec-dev repo. +# This file was generated on 2020-12-31T00:41:34+03:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. # This file contains defaults for RSpec projects. Individual projects diff --git a/.travis.yml b/.travis.yml index 18e252ee74..eed822ca11 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ -# This file was generated on 2020-12-27T14:32:17+00:00 from the rspec-dev repo. +# This file was generated on 2020-12-31T00:41:34+03:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. # In order to install old Rubies, we need to use old Ubuntu distibution. diff --git a/script/ci_functions.sh b/script/ci_functions.sh index 1aab4ea362..a336b5eb4b 100644 --- a/script/ci_functions.sh +++ b/script/ci_functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2020-12-27T14:32:17+00:00 from the rspec-dev repo. +# This file was generated on 2020-12-31T00:41:34+03:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. # Taken from: diff --git a/script/clone_all_rspec_repos b/script/clone_all_rspec_repos index de5b3ad501..4b6ee3cf73 100755 --- a/script/clone_all_rspec_repos +++ b/script/clone_all_rspec_repos @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2020-12-27T14:32:17+00:00 from the rspec-dev repo. +# This file was generated on 2020-12-31T00:41:34+03:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e diff --git a/script/functions.sh b/script/functions.sh index 9c7abe2d0b..061cc76136 100644 --- a/script/functions.sh +++ b/script/functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2020-12-27T14:32:17+00:00 from the rspec-dev repo. +# This file was generated on 2020-12-31T00:41:34+03:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" diff --git a/script/predicate_functions.sh b/script/predicate_functions.sh index 2b79d88160..53ad038019 100644 --- a/script/predicate_functions.sh +++ b/script/predicate_functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2020-12-27T14:32:17+00:00 from the rspec-dev repo. +# This file was generated on 2020-12-31T00:41:34+03:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. function is_mri { diff --git a/script/run_build b/script/run_build index c1fba76c7c..2adbab5a22 100755 --- a/script/run_build +++ b/script/run_build @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2020-12-27T14:32:17+00:00 from the rspec-dev repo. +# This file was generated on 2020-12-31T00:41:34+03:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e @@ -30,6 +30,7 @@ fi if supports_cross_build_checks; then fold "one-by-one specs" run_specs_one_by_one + export NO_COVERAGE=true run_all_spec_suites else echo "Skipping the rest of the build on non-MRI rubies" diff --git a/script/update_rubygems_and_install_bundler b/script/update_rubygems_and_install_bundler index 291b60c3d0..e0e1aece8d 100755 --- a/script/update_rubygems_and_install_bundler +++ b/script/update_rubygems_and_install_bundler @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2020-12-27T14:32:17+00:00 from the rspec-dev repo. +# This file was generated on 2020-12-31T00:41:34+03:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e From 9f8caf9e39fa8d0d62abe0c5082a073ad32985dc Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Sat, 2 Jan 2021 10:57:06 +0000 Subject: [PATCH 039/104] Skip spec which won't pass on legacy CI --- spec/integration/persistence_failures_spec.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/spec/integration/persistence_failures_spec.rb b/spec/integration/persistence_failures_spec.rb index 5c57e13a02..d47f605809 100644 --- a/spec/integration/persistence_failures_spec.rb +++ b/spec/integration/persistence_failures_spec.rb @@ -45,6 +45,7 @@ it 'emits a helpful warning to the user, indicating we cannot read from it, and still runs the spec suite' do + skip "Legacy builds run as root and this will never pass" if ENV['LEGACY_CI'] run_command "spec/1_spec.rb" expected_snippets = [ From 8ecf34e70a4ac5b10b27299898d13b0c5fc24385 Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Sat, 2 Jan 2021 11:03:36 +0000 Subject: [PATCH 040/104] Account for differently named rubies --- features/command_line/rake_task.feature | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/features/command_line/rake_task.feature b/features/command_line/rake_task.feature index bb2fb01d28..ecfe94737d 100644 --- a/features/command_line/rake_task.feature +++ b/features/command_line/rake_task.feature @@ -39,7 +39,7 @@ Feature: rake task When I run `rake` Then the output should match: """ - (ruby|rbx) -I\S+ [\/\S]+\/exe\/rspec + (ruby(\d\.\d)?|rbx) -I\S+ [\/\S]+\/exe\/rspec """ Then the exit status should be 0 @@ -122,7 +122,7 @@ Feature: rake task Then the exit status should be 0 Then the output should match: """ - (ruby|rbx) -I\S+ [\/\S]+\/exe\/rspec --pattern spec[\/\\*{,}]+_spec.rb --tag fast + (ruby(\d\.\d)?|rbx) -I\S+ [\/\S]+\/exe\/rspec --pattern spec[\/\\*{,}]+_spec.rb --tag fast """ Scenario: Passing rake task arguments to the `rspec` command via `rspec_opts` @@ -154,5 +154,5 @@ Feature: rake task Then the exit status should be 0 Then the output should match: """ - (ruby|rbx) -I\S+ [\/\S]+\/exe\/rspec --pattern spec[\/\\*{,}]+_spec.rb --tag fast + (ruby(\d\.\d)?|rbx) -I\S+ [\/\S]+\/exe\/rspec --pattern spec[\/\\*{,}]+_spec.rb --tag fast """ From b9f3b1a50a18b69a85a6a8480115fa115169a16a Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Sat, 2 Jan 2021 11:51:40 +0000 Subject: [PATCH 041/104] Updated ci build scripts (from rspec-dev)main --- .github/workflows/ci.yml | 22 +++++++++++++++++++++- .rubocop_rspec_base.yml | 2 +- .travis.yml | 4 +--- script/ci_functions.sh | 2 +- script/clone_all_rspec_repos | 2 +- script/cucumber.sh | 8 ++++++++ script/functions.sh | 2 +- script/legacy_setup.sh | 20 ++++++++++++++++++++ script/predicate_functions.sh | 2 +- script/run_build | 3 +-- script/update_rubygems_and_install_bundler | 2 +- 11 files changed, 57 insertions(+), 12 deletions(-) create mode 100755 script/cucumber.sh create mode 100755 script/legacy_setup.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e426ca0232..92b0571148 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -# This file was generated on 2020-12-31T00:41:34+03:00 from the rspec-dev repo. +# This file was generated on 2021-01-02T12:13:09+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. name: RSpec CI @@ -67,6 +67,26 @@ jobs: - run: bundle install --binstubs --standalone - run: script/run_build + legacy: + name: Legacy Ruby Builds (${{ matrix.container.version }}) + runs-on: ubuntu-20.04 + container: ${{ matrix.container.tag }} + strategy: + fail-fast: false + matrix: + container: + - version: "2.0" + tag: rspec/ci:2.0.0 + - version: "1.9.3" + tag: rspec/ci:1.9.3 + env: + LEGACY_CI: true + steps: + - uses: actions/checkout@v2 + - run: script/legacy_setup.sh + - run: bundle exec bin/rspec + - run: bundle exec script/cucumber.sh + windows: name: Ruby ${{ matrix.ruby }} (Windows) runs-on: windows-latest diff --git a/.rubocop_rspec_base.yml b/.rubocop_rspec_base.yml index e7dae7a41a..00cf57b2c0 100644 --- a/.rubocop_rspec_base.yml +++ b/.rubocop_rspec_base.yml @@ -1,4 +1,4 @@ -# This file was generated on 2020-12-31T00:41:34+03:00 from the rspec-dev repo. +# This file was generated on 2021-01-02T11:51:40+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. # This file contains defaults for RSpec projects. Individual projects diff --git a/.travis.yml b/.travis.yml index eed822ca11..c721fdb214 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ -# This file was generated on 2020-12-31T00:41:34+03:00 from the rspec-dev repo. +# This file was generated on 2021-01-02T11:51:40+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. # In order to install old Rubies, we need to use old Ubuntu distibution. @@ -17,8 +17,6 @@ script: "script/run_build" rvm: - 1.8.7 - 1.9.2 - - 1.9.3 - - 2.0.0 - ree - jruby-1.7 env: diff --git a/script/ci_functions.sh b/script/ci_functions.sh index a336b5eb4b..59897ca53b 100644 --- a/script/ci_functions.sh +++ b/script/ci_functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2020-12-31T00:41:34+03:00 from the rspec-dev repo. +# This file was generated on 2021-01-02T11:51:40+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. # Taken from: diff --git a/script/clone_all_rspec_repos b/script/clone_all_rspec_repos index 4b6ee3cf73..ce6b7ae83c 100755 --- a/script/clone_all_rspec_repos +++ b/script/clone_all_rspec_repos @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2020-12-31T00:41:34+03:00 from the rspec-dev repo. +# This file was generated on 2021-01-02T11:51:40+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e diff --git a/script/cucumber.sh b/script/cucumber.sh new file mode 100755 index 0000000000..c1cc7a1a28 --- /dev/null +++ b/script/cucumber.sh @@ -0,0 +1,8 @@ +#!/bin/bash +# This file was generated on 2021-01-02T12:13:09+00:00 from the rspec-dev repo. +# DO NOT modify it by hand as your changes will get lost the next time it is generated. + +set -e +source script/functions.sh + +run_cukes diff --git a/script/functions.sh b/script/functions.sh index 061cc76136..dff7bcc747 100644 --- a/script/functions.sh +++ b/script/functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2020-12-31T00:41:34+03:00 from the rspec-dev repo. +# This file was generated on 2021-01-02T11:51:40+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" diff --git a/script/legacy_setup.sh b/script/legacy_setup.sh new file mode 100755 index 0000000000..1e91f31cba --- /dev/null +++ b/script/legacy_setup.sh @@ -0,0 +1,20 @@ +#!/bin/bash +# This file was generated on 2021-01-02T11:51:40+00:00 from the rspec-dev repo. +# DO NOT modify it by hand as your changes will get lost the next time it is generated. + +set -e +source script/functions.sh + +bundle install --standalone --binstubs + +if [ -x ./bin/rspec ]; then + echo "RSpec bin detected" +else + if [ -x ./exe/rspec ]; then + cp ./exe/rspec ./bin/rspec + echo "RSpec restored from exe" + else + echo "No RSpec bin available" + exit 1 + fi +fi diff --git a/script/predicate_functions.sh b/script/predicate_functions.sh index 53ad038019..fe6851417b 100644 --- a/script/predicate_functions.sh +++ b/script/predicate_functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2020-12-31T00:41:34+03:00 from the rspec-dev repo. +# This file was generated on 2021-01-02T11:51:40+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. function is_mri { diff --git a/script/run_build b/script/run_build index 2adbab5a22..e7086de39a 100755 --- a/script/run_build +++ b/script/run_build @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2020-12-31T00:41:34+03:00 from the rspec-dev repo. +# This file was generated on 2021-01-02T11:51:40+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e @@ -30,7 +30,6 @@ fi if supports_cross_build_checks; then fold "one-by-one specs" run_specs_one_by_one - export NO_COVERAGE=true run_all_spec_suites else echo "Skipping the rest of the build on non-MRI rubies" diff --git a/script/update_rubygems_and_install_bundler b/script/update_rubygems_and_install_bundler index e0e1aece8d..0b0d318866 100755 --- a/script/update_rubygems_and_install_bundler +++ b/script/update_rubygems_and_install_bundler @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2020-12-31T00:41:34+03:00 from the rspec-dev repo. +# This file was generated on 2021-01-02T11:51:40+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e From 488817aed2c628aad81e220cc999a8c9c5658555 Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Sat, 2 Jan 2021 12:06:17 +0000 Subject: [PATCH 042/104] Allow for 3 digit ruby numbers --- features/command_line/rake_task.feature | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/features/command_line/rake_task.feature b/features/command_line/rake_task.feature index ecfe94737d..4bb61175d3 100644 --- a/features/command_line/rake_task.feature +++ b/features/command_line/rake_task.feature @@ -39,7 +39,7 @@ Feature: rake task When I run `rake` Then the output should match: """ - (ruby(\d\.\d)?|rbx) -I\S+ [\/\S]+\/exe\/rspec + (ruby(\d\.\d(.\d)?)?|rbx) -I\S+ [\/\S]+\/exe\/rspec """ Then the exit status should be 0 @@ -122,7 +122,7 @@ Feature: rake task Then the exit status should be 0 Then the output should match: """ - (ruby(\d\.\d)?|rbx) -I\S+ [\/\S]+\/exe\/rspec --pattern spec[\/\\*{,}]+_spec.rb --tag fast + (ruby(\d\.\d(.\d)?)?|rbx) -I\S+ [\/\S]+\/exe\/rspec --pattern spec[\/\\*{,}]+_spec.rb --tag fast """ Scenario: Passing rake task arguments to the `rspec` command via `rspec_opts` @@ -154,5 +154,5 @@ Feature: rake task Then the exit status should be 0 Then the output should match: """ - (ruby(\d\.\d)?|rbx) -I\S+ [\/\S]+\/exe\/rspec --pattern spec[\/\\*{,}]+_spec.rb --tag fast + (ruby(\d\.\d(.\d)?)?|rbx) -I\S+ [\/\S]+\/exe\/rspec --pattern spec[\/\\*{,}]+_spec.rb --tag fast """ From 01b0b94135686becf5043f5ec2239412d4e108ef Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Sat, 2 Jan 2021 12:38:44 +0000 Subject: [PATCH 043/104] Updated ci build scripts (from rspec-dev)main --- .github/workflows/ci.yml | 2 +- .rubocop_rspec_base.yml | 2 +- .travis.yml | 2 +- script/ci_functions.sh | 2 +- script/clone_all_rspec_repos | 2 +- script/cucumber.sh | 2 +- script/functions.sh | 2 +- script/legacy_setup.sh | 2 +- script/predicate_functions.sh | 2 +- script/run_build | 2 +- script/update_rubygems_and_install_bundler | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 92b0571148..76bf629194 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -# This file was generated on 2021-01-02T12:13:09+00:00 from the rspec-dev repo. +# This file was generated on 2021-01-02T12:38:44+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. name: RSpec CI diff --git a/.rubocop_rspec_base.yml b/.rubocop_rspec_base.yml index 00cf57b2c0..3b7dacf373 100644 --- a/.rubocop_rspec_base.yml +++ b/.rubocop_rspec_base.yml @@ -1,4 +1,4 @@ -# This file was generated on 2021-01-02T11:51:40+00:00 from the rspec-dev repo. +# This file was generated on 2021-01-02T12:38:44+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. # This file contains defaults for RSpec projects. Individual projects diff --git a/.travis.yml b/.travis.yml index c721fdb214..d794921655 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ -# This file was generated on 2021-01-02T11:51:40+00:00 from the rspec-dev repo. +# This file was generated on 2021-01-02T12:38:44+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. # In order to install old Rubies, we need to use old Ubuntu distibution. diff --git a/script/ci_functions.sh b/script/ci_functions.sh index 59897ca53b..d0655a73b7 100644 --- a/script/ci_functions.sh +++ b/script/ci_functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2021-01-02T11:51:40+00:00 from the rspec-dev repo. +# This file was generated on 2021-01-02T12:38:44+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. # Taken from: diff --git a/script/clone_all_rspec_repos b/script/clone_all_rspec_repos index ce6b7ae83c..43f44fc9c7 100755 --- a/script/clone_all_rspec_repos +++ b/script/clone_all_rspec_repos @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2021-01-02T11:51:40+00:00 from the rspec-dev repo. +# This file was generated on 2021-01-02T12:38:44+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e diff --git a/script/cucumber.sh b/script/cucumber.sh index c1cc7a1a28..851d4b77f9 100755 --- a/script/cucumber.sh +++ b/script/cucumber.sh @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2021-01-02T12:13:09+00:00 from the rspec-dev repo. +# This file was generated on 2021-01-02T12:38:44+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e diff --git a/script/functions.sh b/script/functions.sh index dff7bcc747..3e3eccde7c 100644 --- a/script/functions.sh +++ b/script/functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2021-01-02T11:51:40+00:00 from the rspec-dev repo. +# This file was generated on 2021-01-02T12:38:44+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" diff --git a/script/legacy_setup.sh b/script/legacy_setup.sh index 1e91f31cba..7e5a66e4c5 100755 --- a/script/legacy_setup.sh +++ b/script/legacy_setup.sh @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2021-01-02T11:51:40+00:00 from the rspec-dev repo. +# This file was generated on 2021-01-02T12:38:44+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e diff --git a/script/predicate_functions.sh b/script/predicate_functions.sh index fe6851417b..8e0ec8f37e 100644 --- a/script/predicate_functions.sh +++ b/script/predicate_functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2021-01-02T11:51:40+00:00 from the rspec-dev repo. +# This file was generated on 2021-01-02T12:38:44+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. function is_mri { diff --git a/script/run_build b/script/run_build index e7086de39a..b13f87de55 100755 --- a/script/run_build +++ b/script/run_build @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2021-01-02T11:51:40+00:00 from the rspec-dev repo. +# This file was generated on 2021-01-02T12:38:44+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e diff --git a/script/update_rubygems_and_install_bundler b/script/update_rubygems_and_install_bundler index 0b0d318866..fa1feff981 100755 --- a/script/update_rubygems_and_install_bundler +++ b/script/update_rubygems_and_install_bundler @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2021-01-02T11:51:40+00:00 from the rspec-dev repo. +# This file was generated on 2021-01-02T12:38:44+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e From bddb8d0fa4d7baca4c3e4e0639cef3b416e6d838 Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Sat, 2 Jan 2021 20:21:17 +0000 Subject: [PATCH 044/104] Updated ci build scripts (from rspec-dev)main --- .github/workflows/ci.yml | 5 ++++- .rubocop_rspec_base.yml | 2 +- .travis.yml | 5 +---- script/ci_functions.sh | 2 +- script/clone_all_rspec_repos | 2 +- script/cucumber.sh | 2 +- script/functions.sh | 2 +- script/legacy_setup.sh | 2 +- script/predicate_functions.sh | 2 +- script/run_build | 2 +- script/update_rubygems_and_install_bundler | 2 +- 11 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 76bf629194..77d23a4ed5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -# This file was generated on 2021-01-02T12:38:44+00:00 from the rspec-dev repo. +# This file was generated on 2021-01-02T20:21:17+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. name: RSpec CI @@ -79,8 +79,11 @@ jobs: tag: rspec/ci:2.0.0 - version: "1.9.3" tag: rspec/ci:1.9.3 + - version: "JRuby 1.7" + tag: rspec/ci:jruby-1.7 env: LEGACY_CI: true + JRUBY_OPTS: ${{ matrix.container.jruby_opts || '--dev' }} steps: - uses: actions/checkout@v2 - run: script/legacy_setup.sh diff --git a/.rubocop_rspec_base.yml b/.rubocop_rspec_base.yml index 3b7dacf373..d9a1c7cc98 100644 --- a/.rubocop_rspec_base.yml +++ b/.rubocop_rspec_base.yml @@ -1,4 +1,4 @@ -# This file was generated on 2021-01-02T12:38:44+00:00 from the rspec-dev repo. +# This file was generated on 2021-01-02T20:21:17+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. # This file contains defaults for RSpec projects. Individual projects diff --git a/.travis.yml b/.travis.yml index d794921655..d25d83250a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ -# This file was generated on 2021-01-02T12:38:44+00:00 from the rspec-dev repo. +# This file was generated on 2021-01-02T20:21:17+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. # In order to install old Rubies, we need to use old Ubuntu distibution. @@ -18,9 +18,6 @@ rvm: - 1.8.7 - 1.9.2 - ree - - jruby-1.7 -env: - - JRUBY_OPTS='--dev' matrix: include: - rvm: jruby-1.7 diff --git a/script/ci_functions.sh b/script/ci_functions.sh index d0655a73b7..abb0daad4c 100644 --- a/script/ci_functions.sh +++ b/script/ci_functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2021-01-02T12:38:44+00:00 from the rspec-dev repo. +# This file was generated on 2021-01-02T20:21:17+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. # Taken from: diff --git a/script/clone_all_rspec_repos b/script/clone_all_rspec_repos index 43f44fc9c7..41c5b56b13 100755 --- a/script/clone_all_rspec_repos +++ b/script/clone_all_rspec_repos @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2021-01-02T12:38:44+00:00 from the rspec-dev repo. +# This file was generated on 2021-01-02T20:21:17+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e diff --git a/script/cucumber.sh b/script/cucumber.sh index 851d4b77f9..86048a67d3 100755 --- a/script/cucumber.sh +++ b/script/cucumber.sh @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2021-01-02T12:38:44+00:00 from the rspec-dev repo. +# This file was generated on 2021-01-02T20:21:17+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e diff --git a/script/functions.sh b/script/functions.sh index 3e3eccde7c..c978873a85 100644 --- a/script/functions.sh +++ b/script/functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2021-01-02T12:38:44+00:00 from the rspec-dev repo. +# This file was generated on 2021-01-02T20:21:17+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" diff --git a/script/legacy_setup.sh b/script/legacy_setup.sh index 7e5a66e4c5..d8e2429685 100755 --- a/script/legacy_setup.sh +++ b/script/legacy_setup.sh @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2021-01-02T12:38:44+00:00 from the rspec-dev repo. +# This file was generated on 2021-01-02T20:21:17+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e diff --git a/script/predicate_functions.sh b/script/predicate_functions.sh index 8e0ec8f37e..fa17367d5b 100644 --- a/script/predicate_functions.sh +++ b/script/predicate_functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2021-01-02T12:38:44+00:00 from the rspec-dev repo. +# This file was generated on 2021-01-02T20:21:17+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. function is_mri { diff --git a/script/run_build b/script/run_build index b13f87de55..bea74edfe1 100755 --- a/script/run_build +++ b/script/run_build @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2021-01-02T12:38:44+00:00 from the rspec-dev repo. +# This file was generated on 2021-01-02T20:21:17+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e diff --git a/script/update_rubygems_and_install_bundler b/script/update_rubygems_and_install_bundler index fa1feff981..1c4274e65c 100755 --- a/script/update_rubygems_and_install_bundler +++ b/script/update_rubygems_and_install_bundler @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2021-01-02T12:38:44+00:00 from the rspec-dev repo. +# This file was generated on 2021-01-02T20:21:17+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e From 559be0338003725abda19da53352f7f157de5d74 Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Mon, 4 Jan 2021 08:55:10 +0000 Subject: [PATCH 045/104] Set scenario text based on fork support (fixes a JRuby 1.7 build) --- features/step_definitions/additional_cli_steps.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/features/step_definitions/additional_cli_steps.rb b/features/step_definitions/additional_cli_steps.rb index 0a63b62fda..f1a3dc0037 100644 --- a/features/step_definitions/additional_cli_steps.rb +++ b/features/step_definitions/additional_cli_steps.rb @@ -172,6 +172,10 @@ expected = normalize_durations(expected_output) actual = normalize_durations(last_process.stdout).sub(/\n+\Z/, '') + if !RSpec::Support::RubyFeatures.fork_supported? + expected.gsub!('runner: :fork', 'runner: :shell') + end + if expected.include?("# ...") expected_start, expected_end = expected.split("# ...") expect(actual).to start_with(expected_start).and end_with(expected_end) From c8b23eee65fa72975aaa2b82de1989eeb5af49f1 Mon Sep 17 00:00:00 2001 From: Joel Stimson Date: Mon, 11 Jan 2021 18:44:53 -0800 Subject: [PATCH 046/104] Reset patch-level dependency to 0 A non-zero patch level in the pessimistic version constraint means you can't install the next minor version until its patch level reaches the constraint patch level. --- rspec-core.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rspec-core.gemspec b/rspec-core.gemspec index f6004a26e3..a778f04dde 100644 --- a/rspec-core.gemspec +++ b/rspec-core.gemspec @@ -42,7 +42,7 @@ Gem::Specification.new do |s| s.add_runtime_dependency "rspec-support", "= #{RSpec::Core::Version::STRING}" else # rspec-support must otherwise match our major/minor version - s.add_runtime_dependency "rspec-support", "~> #{RSpec::Core::Version::STRING.split('.')[0..1].concat(['3']).join('.')}" + s.add_runtime_dependency "rspec-support", "~> #{RSpec::Core::Version::STRING.split('.')[0..1].concat(['0']).join('.')}" end s.add_development_dependency "cucumber", "~> 1.3" From 3a91ee44bb0aeebaab360fcedc7705c1f4133189 Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Fri, 22 Jan 2021 09:55:42 +0000 Subject: [PATCH 047/104] Updated ci build scripts (from rspec-dev)main --- .github/workflows/ci.yml | 18 ++++++++++++++++-- .rubocop_rspec_base.yml | 2 +- .travis.yml | 7 +------ script/ci_functions.sh | 2 +- script/clone_all_rspec_repos | 2 +- script/cucumber.sh | 2 +- script/functions.sh | 2 +- script/legacy_setup.sh | 4 ++-- script/predicate_functions.sh | 2 +- script/run_build | 3 ++- script/update_rubygems_and_install_bundler | 2 +- 11 files changed, 28 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 77d23a4ed5..2908673408 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -# This file was generated on 2021-01-02T20:21:17+00:00 from the rspec-dev repo. +# This file was generated on 2021-01-22T09:55:42+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. name: RSpec CI @@ -70,7 +70,9 @@ jobs: legacy: name: Legacy Ruby Builds (${{ matrix.container.version }}) runs-on: ubuntu-20.04 - container: ${{ matrix.container.tag }} + container: + image: ${{ matrix.container.tag }} + options: ${{ matrix.container.options || '--add-host github-complains-if-this-is-empty.com:127.0.0.1' }} strategy: fail-fast: false matrix: @@ -79,13 +81,25 @@ jobs: tag: rspec/ci:2.0.0 - version: "1.9.3" tag: rspec/ci:1.9.3 + - version: "1.9.2" + tag: rspec/ci:1.9.2 + options: "--add-host rubygems.org:151.101.0.70 --add-host api.rubygems.org:151.101.0.70" + - version: "REE" + tag: rspec/ci:ree + options: "--add-host rubygems.org:151.101.0.70 --add-host api.rubygems.org:151.101.0.70" - version: "JRuby 1.7" tag: rspec/ci:jruby-1.7 + - version: "JRuby 1.7 1.8 mode" + tag: rspec/ci:jruby-1.7 + jruby_opts: '--dev --1.8' + pre: gem uninstall jruby-openssl + options: "--add-host rubygems.org:151.101.0.70 --add-host api.rubygems.org:151.101.0.70" env: LEGACY_CI: true JRUBY_OPTS: ${{ matrix.container.jruby_opts || '--dev' }} steps: - uses: actions/checkout@v2 + - run: ${{ matrix.container.pre }} - run: script/legacy_setup.sh - run: bundle exec bin/rspec - run: bundle exec script/cucumber.sh diff --git a/.rubocop_rspec_base.yml b/.rubocop_rspec_base.yml index d9a1c7cc98..5be8091d15 100644 --- a/.rubocop_rspec_base.yml +++ b/.rubocop_rspec_base.yml @@ -1,4 +1,4 @@ -# This file was generated on 2021-01-02T20:21:17+00:00 from the rspec-dev repo. +# This file was generated on 2021-01-22T09:55:42+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. # This file contains defaults for RSpec projects. Individual projects diff --git a/.travis.yml b/.travis.yml index d25d83250a..0e66d86e89 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ -# This file was generated on 2021-01-02T20:21:17+00:00 from the rspec-dev repo. +# This file was generated on 2021-01-22T09:55:42+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. # In order to install old Rubies, we need to use old Ubuntu distibution. @@ -16,12 +16,7 @@ bundler_args: "--binstubs --standalone --without documentation --path ../bundle" script: "script/run_build" rvm: - 1.8.7 - - 1.9.2 - - ree matrix: - include: - - rvm: jruby-1.7 - env: JRUBY_OPTS='--dev --1.8' fast_finish: true branches: only: diff --git a/script/ci_functions.sh b/script/ci_functions.sh index abb0daad4c..8a1ac0694e 100644 --- a/script/ci_functions.sh +++ b/script/ci_functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2021-01-02T20:21:17+00:00 from the rspec-dev repo. +# This file was generated on 2021-01-22T09:55:42+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. # Taken from: diff --git a/script/clone_all_rspec_repos b/script/clone_all_rspec_repos index 41c5b56b13..80d4cd88cf 100755 --- a/script/clone_all_rspec_repos +++ b/script/clone_all_rspec_repos @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2021-01-02T20:21:17+00:00 from the rspec-dev repo. +# This file was generated on 2021-01-22T09:55:42+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e diff --git a/script/cucumber.sh b/script/cucumber.sh index 86048a67d3..90f8738294 100755 --- a/script/cucumber.sh +++ b/script/cucumber.sh @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2021-01-02T20:21:17+00:00 from the rspec-dev repo. +# This file was generated on 2021-01-22T09:55:42+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e diff --git a/script/functions.sh b/script/functions.sh index c978873a85..7bf6d04b08 100644 --- a/script/functions.sh +++ b/script/functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2021-01-02T20:21:17+00:00 from the rspec-dev repo. +# This file was generated on 2021-01-22T09:55:42+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" diff --git a/script/legacy_setup.sh b/script/legacy_setup.sh index d8e2429685..126b25c7c3 100755 --- a/script/legacy_setup.sh +++ b/script/legacy_setup.sh @@ -1,11 +1,11 @@ #!/bin/bash -# This file was generated on 2021-01-02T20:21:17+00:00 from the rspec-dev repo. +# This file was generated on 2021-01-22T09:55:42+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e source script/functions.sh -bundle install --standalone --binstubs +bundle install --standalone --binstubs --without coverage documentation if [ -x ./bin/rspec ]; then echo "RSpec bin detected" diff --git a/script/predicate_functions.sh b/script/predicate_functions.sh index fa17367d5b..d771e356e3 100644 --- a/script/predicate_functions.sh +++ b/script/predicate_functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2021-01-02T20:21:17+00:00 from the rspec-dev repo. +# This file was generated on 2021-01-22T09:55:42+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. function is_mri { diff --git a/script/run_build b/script/run_build index bea74edfe1..d428621580 100755 --- a/script/run_build +++ b/script/run_build @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2021-01-02T20:21:17+00:00 from the rspec-dev repo. +# This file was generated on 2021-01-22T09:55:42+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e @@ -30,6 +30,7 @@ fi if supports_cross_build_checks; then fold "one-by-one specs" run_specs_one_by_one + export NO_COVERAGE=true run_all_spec_suites else echo "Skipping the rest of the build on non-MRI rubies" diff --git a/script/update_rubygems_and_install_bundler b/script/update_rubygems_and_install_bundler index 1c4274e65c..fe478b3231 100755 --- a/script/update_rubygems_and_install_bundler +++ b/script/update_rubygems_and_install_bundler @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2021-01-02T20:21:17+00:00 from the rspec-dev repo. +# This file was generated on 2021-01-22T09:55:42+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e From 30fafe43f7c248dbfedd32f261a578d2a58c4389 Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Fri, 22 Jan 2021 10:25:01 +0000 Subject: [PATCH 048/104] Move yard to documentation group --- Gemfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Gemfile b/Gemfile index 85c0ac3297..a84e06b1a7 100644 --- a/Gemfile +++ b/Gemfile @@ -26,12 +26,11 @@ else gem 'diff-lcs', '~> 1.4', '>= 1.4.3' end -gem 'yard', '~> 0.9.24', :require => false - ### deps for rdoc.info group :documentation do gem 'redcarpet', :platform => :mri gem 'github-markup', :platform => :mri + gem 'yard', '~> 0.9.24', :require => false end if RUBY_VERSION < '2.0.0' || RUBY_ENGINE == 'java' From 0f134815412a684b7fc6889f9335b5616e8bffe1 Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Fri, 22 Jan 2021 10:25:25 +0000 Subject: [PATCH 049/104] Pin thor --- Gemfile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Gemfile b/Gemfile index a84e06b1a7..521b9305dc 100644 --- a/Gemfile +++ b/Gemfile @@ -33,6 +33,12 @@ group :documentation do gem 'yard', '~> 0.9.24', :require => false end +if RUBY_VERSION < '2.0.0' + gem 'thor', '< 1.0.0' +else + gem 'thor', '> 1.0.0' +end + if RUBY_VERSION < '2.0.0' || RUBY_ENGINE == 'java' gem 'json', '< 2.0.0' else From ee6d9fd20af25a8434007301012199fb416d7f5d Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Fri, 22 Jan 2021 10:25:45 +0000 Subject: [PATCH 050/104] Pin chilprocess --- Gemfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Gemfile b/Gemfile index 521b9305dc..52bb1c5545 100644 --- a/Gemfile +++ b/Gemfile @@ -58,14 +58,16 @@ end if RUBY_VERSION < '2.3.0' && !!(RbConfig::CONFIG['host_os'] =~ /cygwin|mswin|mingw|bccwin|wince|emx/) gem "childprocess", "< 1.0.0" +elsif RUBY_VERSION < '2.0.0' + gem "childprocess", "< 1.0.0" +else + gem "childprocess", "> 1.0.0" end platforms :jruby do if RUBY_VERSION < '1.9.0' # Pin jruby-openssl on older J Ruby gem "jruby-openssl", "< 0.10.0" - # Pin child-process on older J Ruby - gem "childprocess", "< 1.0.0" else gem "jruby-openssl" end From ffe9fc96e80d7a5a6b5dcac784d752611e3448cc Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Fri, 22 Jan 2021 10:25:57 +0000 Subject: [PATCH 051/104] Setup coverage group --- Gemfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Gemfile b/Gemfile index 52bb1c5545..cb1c7385e7 100644 --- a/Gemfile +++ b/Gemfile @@ -73,7 +73,9 @@ platforms :jruby do end end -gem 'simplecov', '~> 0.8' +group :coverage do + gem 'simplecov', '~> 0.8' +end # No need to run rubocop on earlier versions if RUBY_VERSION >= '2.4' && RUBY_ENGINE == 'ruby' @@ -87,7 +89,6 @@ if RUBY_VERSION < '2.4.0' gem 'minitest', '< 5.12.0' end - gem 'contracts', '< 0.16' if RUBY_VERSION < '1.9.0' eval File.read('Gemfile-custom') if File.exist?('Gemfile-custom') From cf88d4e61dbc747a595d4b0a86ea94b914ec73ae Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Fri, 22 Jan 2021 18:13:35 +0000 Subject: [PATCH 052/104] Updated ci build scripts (from rspec-dev)main --- .github/workflows/ci.yml | 5 ++++- .rubocop_rspec_base.yml | 2 +- .travis.yml | 2 +- script/ci_functions.sh | 2 +- script/clone_all_rspec_repos | 2 +- script/cucumber.sh | 2 +- script/functions.sh | 2 +- script/legacy_setup.sh | 2 +- script/predicate_functions.sh | 2 +- script/run_build | 2 +- script/update_rubygems_and_install_bundler | 2 +- 11 files changed, 14 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2908673408..00ffbce24a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -# This file was generated on 2021-01-22T09:55:42+00:00 from the rspec-dev repo. +# This file was generated on 2021-01-22T18:13:35+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. name: RSpec CI @@ -84,6 +84,9 @@ jobs: - version: "1.9.2" tag: rspec/ci:1.9.2 options: "--add-host rubygems.org:151.101.0.70 --add-host api.rubygems.org:151.101.0.70" + - version: "1.8.7" + tag: rspec/ci:1.8.7 + options: "--add-host rubygems.org:151.101.0.70 --add-host api.rubygems.org:151.101.0.70" - version: "REE" tag: rspec/ci:ree options: "--add-host rubygems.org:151.101.0.70 --add-host api.rubygems.org:151.101.0.70" diff --git a/.rubocop_rspec_base.yml b/.rubocop_rspec_base.yml index 5be8091d15..f4850e72a8 100644 --- a/.rubocop_rspec_base.yml +++ b/.rubocop_rspec_base.yml @@ -1,4 +1,4 @@ -# This file was generated on 2021-01-22T09:55:42+00:00 from the rspec-dev repo. +# This file was generated on 2021-01-22T18:13:35+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. # This file contains defaults for RSpec projects. Individual projects diff --git a/.travis.yml b/.travis.yml index 0e66d86e89..a1d6db5c83 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ -# This file was generated on 2021-01-22T09:55:42+00:00 from the rspec-dev repo. +# This file was generated on 2021-01-22T18:13:35+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. # In order to install old Rubies, we need to use old Ubuntu distibution. diff --git a/script/ci_functions.sh b/script/ci_functions.sh index 8a1ac0694e..ccd21f812f 100644 --- a/script/ci_functions.sh +++ b/script/ci_functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2021-01-22T09:55:42+00:00 from the rspec-dev repo. +# This file was generated on 2021-01-22T18:13:35+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. # Taken from: diff --git a/script/clone_all_rspec_repos b/script/clone_all_rspec_repos index 80d4cd88cf..1d7cbbb0e4 100755 --- a/script/clone_all_rspec_repos +++ b/script/clone_all_rspec_repos @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2021-01-22T09:55:42+00:00 from the rspec-dev repo. +# This file was generated on 2021-01-22T18:13:35+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e diff --git a/script/cucumber.sh b/script/cucumber.sh index 90f8738294..436d1f8764 100755 --- a/script/cucumber.sh +++ b/script/cucumber.sh @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2021-01-22T09:55:42+00:00 from the rspec-dev repo. +# This file was generated on 2021-01-22T18:13:35+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e diff --git a/script/functions.sh b/script/functions.sh index 7bf6d04b08..49059e53bf 100644 --- a/script/functions.sh +++ b/script/functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2021-01-22T09:55:42+00:00 from the rspec-dev repo. +# This file was generated on 2021-01-22T18:13:35+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" diff --git a/script/legacy_setup.sh b/script/legacy_setup.sh index 126b25c7c3..e81e45a285 100755 --- a/script/legacy_setup.sh +++ b/script/legacy_setup.sh @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2021-01-22T09:55:42+00:00 from the rspec-dev repo. +# This file was generated on 2021-01-22T18:13:35+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e diff --git a/script/predicate_functions.sh b/script/predicate_functions.sh index d771e356e3..e44af601ae 100644 --- a/script/predicate_functions.sh +++ b/script/predicate_functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2021-01-22T09:55:42+00:00 from the rspec-dev repo. +# This file was generated on 2021-01-22T18:13:35+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. function is_mri { diff --git a/script/run_build b/script/run_build index d428621580..f83340ebf3 100755 --- a/script/run_build +++ b/script/run_build @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2021-01-22T09:55:42+00:00 from the rspec-dev repo. +# This file was generated on 2021-01-22T18:13:35+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e diff --git a/script/update_rubygems_and_install_bundler b/script/update_rubygems_and_install_bundler index fe478b3231..4a01b3bff2 100755 --- a/script/update_rubygems_and_install_bundler +++ b/script/update_rubygems_and_install_bundler @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2021-01-22T09:55:42+00:00 from the rspec-dev repo. +# This file was generated on 2021-01-22T18:13:35+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e From 160b77336c67d8eb79cb16ca5bb9dfdaab200bed Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Fri, 22 Jan 2021 18:53:33 +0000 Subject: [PATCH 053/104] Remove .travis.yml --- .travis.yml | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index a1d6db5c83..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,25 +0,0 @@ -# This file was generated on 2021-01-22T18:13:35+00:00 from the rspec-dev repo. -# DO NOT modify it by hand as your changes will get lost the next time it is generated. - -# In order to install old Rubies, we need to use old Ubuntu distibution. -dist: trusty -language: ruby -email: false -cache: - directories: - - ../bundle -before_install: - - "script/update_rubygems_and_install_bundler" - - unset _JAVA_OPTIONS - - "script/clone_all_rspec_repos" -bundler_args: "--binstubs --standalone --without documentation --path ../bundle" -script: "script/run_build" -rvm: - - 1.8.7 -matrix: - fast_finish: true -branches: - only: - - main - - /^\d+-\d+-maintenance$/ - - /^\d+-\d+-dev$/ From 28bf6bb44c49d36b1107e6697ecb6500c926398f Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Fri, 22 Jan 2021 19:46:23 +0000 Subject: [PATCH 054/104] Build badge [skip ci] --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e9c3649eee..18c7b5a9a1 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# rspec-core [![Build Status](https://secure.travis-ci.org/rspec/rspec-core.svg?branch=main)](http://travis-ci.org/rspec/rspec-core) [![Code Climate](https://codeclimate.com/github/rspec/rspec-core.svg)](https://codeclimate.com/github/rspec/rspec-core) +# rspec-core [![Build Status](https://github.com/rspec/rspec-core/workflows/ci/badge.svg)](https://github.com/rspec/rspec-core/actions) [![Code Climate](https://codeclimate.com/github/rspec/rspec-core.svg)](https://codeclimate.com/github/rspec/rspec-core) rspec-core provides the structure for writing executable examples of how your code should behave, and an `rspec` command with tools to constrain which From bea9f5e4871073e1e4f99e0a2dbf708b660f1a6e Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Fri, 22 Jan 2021 20:24:47 +0000 Subject: [PATCH 055/104] Fixed build status --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 18c7b5a9a1..6cf70ebbf2 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# rspec-core [![Build Status](https://github.com/rspec/rspec-core/workflows/ci/badge.svg)](https://github.com/rspec/rspec-core/actions) [![Code Climate](https://codeclimate.com/github/rspec/rspec-core.svg)](https://codeclimate.com/github/rspec/rspec-core) +# rspec-core [![Build Status](https://github.com/rspec/rspec-core/workflows/RSpec%20CI/badge.svg)](https://github.com/rspec/rspec-core/actions) [![Code Climate](https://codeclimate.com/github/rspec/rspec-core.svg)](https://codeclimate.com/github/rspec/rspec-core) rspec-core provides the structure for writing executable examples of how your code should behave, and an `rspec` command with tools to constrain which From d04af61cb96862818ca504135d188e48c106e9fa Mon Sep 17 00:00:00 2001 From: Phil Pirozhkov Date: Tue, 15 Dec 2020 23:34:05 +0300 Subject: [PATCH 056/104] Prevent should from circumventing target check By directly instantiating expectation handler, should/should_not was circumventing enforce_value_expectation check. subject(:action) { -> { raise } } it { should raise_error StandardError } would not print "The implicit block expectation syntax is deprecated", while subject(:action) { -> { raise } } it { is_expected.to raise_error StandardError } will. See https://github.com/rspec/rspec-expectations/pull/1139 --- lib/rspec/core/memoized_helpers.rb | 22 ++++++++++++++++++++++ spec/rspec/core/memoized_helpers_spec.rb | 22 ++++++++++++++++++++++ 2 files changed, 44 insertions(+) diff --git a/lib/rspec/core/memoized_helpers.rb b/lib/rspec/core/memoized_helpers.rb index 771c12d716..87ee8e9359 100644 --- a/lib/rspec/core/memoized_helpers.rb +++ b/lib/rspec/core/memoized_helpers.rb @@ -78,6 +78,7 @@ def subject # @note If you are using RSpec's newer expect-based syntax you may # want to use `is_expected.to` instead of `should`. def should(matcher=nil, message=nil) + enforce_value_expectation(matcher, 'should') RSpec::Expectations::PositiveExpectationHandler.handle_matcher(subject, matcher, message) end @@ -97,6 +98,7 @@ def should(matcher=nil, message=nil) # @note If you are using RSpec's newer expect-based syntax you may # want to use `is_expected.to_not` instead of `should_not`. def should_not(matcher=nil, message=nil) + enforce_value_expectation(matcher, 'should_not') RSpec::Expectations::NegativeExpectationHandler.handle_matcher(subject, matcher, message) end @@ -144,6 +146,26 @@ def __init_memoized end end + # @private + def enforce_value_expectation(matcher, method_name) + return if matcher_supports_value_expectations?(matcher) + + RSpec.deprecate( + "#{method_name} #{RSpec::Support::ObjectFormatter.format(matcher)}", + :message => + "The implicit block expectation syntax is deprecated, you should pass " \ + "a block to `expect` to use the provided block expectation matcher " \ + "(#{RSpec::Support::ObjectFormatter.format(matcher)}), " \ + "or the matcher must implement `supports_value_expectations?`." + ) + end + + def matcher_supports_value_expectations?(matcher) + matcher.supports_value_expectations? + rescue + true + end + # @private class ThreadsafeMemoized def initialize diff --git a/spec/rspec/core/memoized_helpers_spec.rb b/spec/rspec/core/memoized_helpers_spec.rb index dc2da63f82..4987549853 100644 --- a/spec/rspec/core/memoized_helpers_spec.rb +++ b/spec/rspec/core/memoized_helpers_spec.rb @@ -630,6 +630,28 @@ def hello_message; "Hello from module"; end end end + RSpec.describe 'implicit block expectation syntax' do + matcher :block_matcher do + match { |actual| true } + supports_block_expectations + def supports_value_expectations? + false + end + end + + subject { 'value or a Proc' } + + it '`should` prints a deprecation warning when given a value' do + expect_warn_deprecation(/The implicit block expectation syntax is deprecated, you should pass/) + expect { should block_matcher }.not_to raise_error + end + + it '`should_not` prints a deprecation warning when given a value' do + expect_warn_deprecation(/The implicit block expectation syntax is deprecated, you should pass/) + expect { should_not block_matcher }.to raise_error(Exception) + end + end + RSpec.describe 'Module#define_method' do it 'retains its normal private visibility on Ruby versions where it is normally private', :if => RUBY_VERSION < '2.5' do a_module = Module.new From 866b98bee11aa636c38a4418c62c52fa38440d2d Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Sat, 30 Jan 2021 10:20:57 +0000 Subject: [PATCH 057/104] Fix for JRuby 9.1.17.0 require_relative --- spec/support/aruba_support.rb | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/spec/support/aruba_support.rb b/spec/support/aruba_support.rb index 55050370f6..5f8383f2db 100644 --- a/spec/support/aruba_support.rb +++ b/spec/support/aruba_support.rb @@ -1,3 +1,25 @@ +if RSpec::Support::Ruby.jruby? && RSpec::Support::Ruby.jruby_version == "9.1.17.0" + # A regression appeared in require_relative in JRuby 9.1.17.0 where require some + # how ends up private, this monkey patch uses `send` + module Kernel + module_function + def require_relative(relative_arg) + relative_arg = relative_arg.to_path if relative_arg.respond_to? :to_path + relative_arg = JRuby::Type.convert_to_str(relative_arg) + + caller.first.rindex(/:\d+:in /) + file = $` # just the filename + raise LoadError, "cannot infer basepath" if /\A\((.*)\)/ =~ file # eval etc. + + absolute_feature = File.expand_path(relative_arg, File.dirname(File.realpath(file))) + + # This was the orginal: + # ::Kernel.require absolute_feature + ::Kernel.send(:require, absolute_feature) + end + end +end + module ArubaLoader extend RSpec::Support::WithIsolatedStdErr with_isolated_stderr do From 12e12b989fa1e56d6e767629342cc4485e94a182 Mon Sep 17 00:00:00 2001 From: Mike Jarema Date: Wed, 20 Jan 2021 00:34:49 -0500 Subject: [PATCH 058/104] When Encoding.default_external is set, eg. Rails, ensure RSpec::Core::Bisect::Channel can send and receive binary data (encoded by Marshal.dump) --- lib/rspec/core/bisect/utilities.rb | 13 ++++++++- spec/rspec/core/bisect/utilities_spec.rb | 36 ++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 1 deletion(-) diff --git a/lib/rspec/core/bisect/utilities.rb b/lib/rspec/core/bisect/utilities.rb index ff031e6405..4600f35bf5 100644 --- a/lib/rspec/core/bisect/utilities.rb +++ b/lib/rspec/core/bisect/utilities.rb @@ -29,11 +29,22 @@ def publish(event, *args) end # Wraps a pipe to support sending objects between a child and - # parent process. + # parent process. Where supported, encoding is explicitly + # set to ensure binary data is able to pass from child to + # parent. # @private class Channel + if String.method_defined?(:encoding) + MARSHAL_DUMP_ENCODING = Marshal.dump("").encoding + end + def initialize @read_io, @write_io = IO.pipe + + if defined?(MARSHAL_DUMP_ENCODING) && IO.method_defined?(:set_encoding) + # Ensure the pipe can send any content produced by Marshal.dump + @write_io.set_encoding MARSHAL_DUMP_ENCODING + end end def send(message) diff --git a/spec/rspec/core/bisect/utilities_spec.rb b/spec/rspec/core/bisect/utilities_spec.rb index 2cd3fd9c98..d33d64c45c 100644 --- a/spec/rspec/core/bisect/utilities_spec.rb +++ b/spec/rspec/core/bisect/utilities_spec.rb @@ -36,5 +36,41 @@ def foo(notification); end expect(channel.receive).to eq :value_from_child end + + describe "in a UTF-8 encoding context (where possible)" do + if defined?(Encoding) + around(:each) do |example| + old_external = old_internal = nil + + ignoring_warnings do + old_external, Encoding.default_external = Encoding.default_external, Encoding::UTF_8 + old_internal, Encoding.default_internal = Encoding.default_internal, Encoding::UTF_8 + end + + example.run + + ignoring_warnings do + Encoding.default_external = old_external + Encoding.default_internal = old_internal + end + end + end + + it "successfully sends binary data within a process" do + channel = Bisect::Channel.new + expect { channel.send("\xF8") }.not_to raise_error + end + + it "successfully sends binary data from a child process to its parent process" do + channel = Bisect::Channel.new + + in_sub_process do + channel.send("\xF8") + end + + expect(channel.receive).to eq("\xF8") + end + end + end end From ecb65d2d4ea7b381472e3084f45e2da94e00ce91 Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Sat, 30 Jan 2021 16:30:19 +0000 Subject: [PATCH 059/104] Changelog for #2852 --- Changelog.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Changelog.md b/Changelog.md index 51df39ce09..a3bcc69c4a 100644 --- a/Changelog.md +++ b/Changelog.md @@ -6,6 +6,10 @@ Enhancements: * Improve pluralisation of words ending with `s` (like process). (Joshua Pinter, #2779) * Add ordering by file modification time (most recent first). (Matheus Richard, #2778) +Bug fixes: + +* Ensure bisect communication uses consistent encoding. (Mike Jarema, #2852) + ### 3.10.1 / 2020-12-27 [Full Changelog](http://github.com/rspec/rspec-core/compare/v3.10.0...v3.10.1) From ac1ee453dd261946a70b5393a51e52c177e1d188 Mon Sep 17 00:00:00 2001 From: Kenichi Kamiya Date: Sun, 21 Feb 2021 00:06:41 +0900 Subject: [PATCH 060/104] Fix YARD type syntax --- lib/rspec/core/formatters.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rspec/core/formatters.rb b/lib/rspec/core/formatters.rb index a693a80c5c..8ca9112b8a 100644 --- a/lib/rspec/core/formatters.rb +++ b/lib/rspec/core/formatters.rb @@ -79,7 +79,7 @@ module RSpec::Core::Formatters # Register the formatter class # @param formatter_class [Class] formatter class to register - # @param notifications [Symbol, ...] one or more notifications to be + # @param notifications [Array] one or more notifications to be # registered to the specified formatter # # @see RSpec::Core::Formatters::BaseFormatter From ea829a1f62c1ea3b6413692f2ebf6e66a966c4ad Mon Sep 17 00:00:00 2001 From: Phil Pirozhkov Date: Sat, 20 Feb 2021 12:27:52 +0300 Subject: [PATCH 061/104] Clarify pending docs --- lib/rspec/core/pending.rb | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/lib/rspec/core/pending.rb b/lib/rspec/core/pending.rb index f04e3be3b7..8b92ea8364 100644 --- a/lib/rspec/core/pending.rb +++ b/lib/rspec/core/pending.rb @@ -38,7 +38,7 @@ class PendingExampleFixedError < StandardError; end # @param message [String] optional message to add to the summary report. # # @example - # describe "an example" do + # describe "some behaviour" do # # reported as "Pending: no reason given" # it "is pending with no message" do # pending @@ -52,21 +52,13 @@ class PendingExampleFixedError < StandardError; end # end # end # - # @note `before(:example)` hooks are eval'd when you use the `pending` - # method within an example. If you want to declare an example `pending` - # and bypass the `before` hooks as well, you can pass `:pending => true` - # to the `it` method: - # - # it "does something", :pending => true do - # # ... - # end - # - # or pass `:pending => "something else getting finished"` to add a - # message to the summary report: - # - # it "does something", :pending => "something else getting finished" do - # # ... - # end + # @note When using `pending` inside an example body using this method + # hooks, such as `before(:example)`, have already be run. This means that + # a failure from the code in the `before` hook will prevent the example + # from being considered pending, as the example body would not be + # executed. If you need to consider hooks as pending as well you can use + # the pending metadata as an alternative, e.g. + # `it "does something", pending: "message"`. def pending(message=nil) current_example = RSpec.current_example From ea8554afd1a2b63677c6593059fa8f2476181deb Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Fri, 26 Feb 2021 20:39:11 +0000 Subject: [PATCH 062/104] Remove trailing whitespace --- lib/rspec/core/pending.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rspec/core/pending.rb b/lib/rspec/core/pending.rb index 8b92ea8364..c0f394aeee 100644 --- a/lib/rspec/core/pending.rb +++ b/lib/rspec/core/pending.rb @@ -57,7 +57,7 @@ class PendingExampleFixedError < StandardError; end # a failure from the code in the `before` hook will prevent the example # from being considered pending, as the example body would not be # executed. If you need to consider hooks as pending as well you can use - # the pending metadata as an alternative, e.g. + # the pending metadata as an alternative, e.g. # `it "does something", pending: "message"`. def pending(message=nil) current_example = RSpec.current_example From d19d76e8d47d9120dd9e7d084c9e1044093187c7 Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Fri, 23 Apr 2021 09:17:21 +0100 Subject: [PATCH 063/104] Updated ci build scripts (from rspec-dev)main --- .github/workflows/ci.yml | 12 ++++++------ .rubocop_rspec_base.yml | 2 +- script/ci_functions.sh | 2 +- script/clone_all_rspec_repos | 2 +- script/cucumber.sh | 2 +- script/functions.sh | 2 +- script/legacy_setup.sh | 2 +- script/predicate_functions.sh | 2 +- script/run_build | 2 +- script/update_rubygems_and_install_bundler | 2 +- 10 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 00ffbce24a..17c14a3eb5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -# This file was generated on 2021-01-22T18:13:35+00:00 from the rspec-dev repo. +# This file was generated on 2021-04-23T09:17:21+01:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. name: RSpec CI @@ -22,7 +22,7 @@ jobs: strategy: matrix: ruby: - - 3.0 + - '3.0' - 2.7 - 2.6 - 2.5 @@ -83,20 +83,20 @@ jobs: tag: rspec/ci:1.9.3 - version: "1.9.2" tag: rspec/ci:1.9.2 - options: "--add-host rubygems.org:151.101.0.70 --add-host api.rubygems.org:151.101.0.70" + options: "--add-host rubygems.org:151.101.129.227 --add-host api.rubygems.org:151.101.129.227" - version: "1.8.7" tag: rspec/ci:1.8.7 - options: "--add-host rubygems.org:151.101.0.70 --add-host api.rubygems.org:151.101.0.70" + options: "--add-host rubygems.org:151.101.129.227 --add-host api.rubygems.org:151.101.129.227" - version: "REE" tag: rspec/ci:ree - options: "--add-host rubygems.org:151.101.0.70 --add-host api.rubygems.org:151.101.0.70" + options: "--add-host rubygems.org:151.101.129.227 --add-host api.rubygems.org:151.101.129.227" - version: "JRuby 1.7" tag: rspec/ci:jruby-1.7 - version: "JRuby 1.7 1.8 mode" tag: rspec/ci:jruby-1.7 jruby_opts: '--dev --1.8' pre: gem uninstall jruby-openssl - options: "--add-host rubygems.org:151.101.0.70 --add-host api.rubygems.org:151.101.0.70" + options: "--add-host rubygems.org:151.101.129.227 --add-host api.rubygems.org:151.101.129.227" env: LEGACY_CI: true JRUBY_OPTS: ${{ matrix.container.jruby_opts || '--dev' }} diff --git a/.rubocop_rspec_base.yml b/.rubocop_rspec_base.yml index f4850e72a8..dbd51b8080 100644 --- a/.rubocop_rspec_base.yml +++ b/.rubocop_rspec_base.yml @@ -1,4 +1,4 @@ -# This file was generated on 2021-01-22T18:13:35+00:00 from the rspec-dev repo. +# This file was generated on 2021-04-23T09:17:21+01:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. # This file contains defaults for RSpec projects. Individual projects diff --git a/script/ci_functions.sh b/script/ci_functions.sh index ccd21f812f..d33106aa97 100644 --- a/script/ci_functions.sh +++ b/script/ci_functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2021-01-22T18:13:35+00:00 from the rspec-dev repo. +# This file was generated on 2021-04-23T09:17:21+01:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. # Taken from: diff --git a/script/clone_all_rspec_repos b/script/clone_all_rspec_repos index 1d7cbbb0e4..cc9e0c7a8b 100755 --- a/script/clone_all_rspec_repos +++ b/script/clone_all_rspec_repos @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2021-01-22T18:13:35+00:00 from the rspec-dev repo. +# This file was generated on 2021-04-23T09:17:21+01:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e diff --git a/script/cucumber.sh b/script/cucumber.sh index 436d1f8764..50990e77bc 100755 --- a/script/cucumber.sh +++ b/script/cucumber.sh @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2021-01-22T18:13:35+00:00 from the rspec-dev repo. +# This file was generated on 2021-04-23T09:17:21+01:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e diff --git a/script/functions.sh b/script/functions.sh index 49059e53bf..9e9d00a0bf 100644 --- a/script/functions.sh +++ b/script/functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2021-01-22T18:13:35+00:00 from the rspec-dev repo. +# This file was generated on 2021-04-23T09:17:21+01:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" diff --git a/script/legacy_setup.sh b/script/legacy_setup.sh index e81e45a285..ffa0eed436 100755 --- a/script/legacy_setup.sh +++ b/script/legacy_setup.sh @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2021-01-22T18:13:35+00:00 from the rspec-dev repo. +# This file was generated on 2021-04-23T09:17:21+01:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e diff --git a/script/predicate_functions.sh b/script/predicate_functions.sh index e44af601ae..e77bdca769 100644 --- a/script/predicate_functions.sh +++ b/script/predicate_functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2021-01-22T18:13:35+00:00 from the rspec-dev repo. +# This file was generated on 2021-04-23T09:17:21+01:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. function is_mri { diff --git a/script/run_build b/script/run_build index f83340ebf3..26ba251ec2 100755 --- a/script/run_build +++ b/script/run_build @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2021-01-22T18:13:35+00:00 from the rspec-dev repo. +# This file was generated on 2021-04-23T09:17:21+01:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e diff --git a/script/update_rubygems_and_install_bundler b/script/update_rubygems_and_install_bundler index 4a01b3bff2..3469174f8b 100755 --- a/script/update_rubygems_and_install_bundler +++ b/script/update_rubygems_and_install_bundler @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2021-01-22T18:13:35+00:00 from the rspec-dev repo. +# This file was generated on 2021-04-23T09:17:21+01:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e From 7f9efcc9ee3ae02b55cd821fdec57e3f70f5410c Mon Sep 17 00:00:00 2001 From: Liberatys Date: Tue, 20 Apr 2021 21:04:32 +0200 Subject: [PATCH 064/104] Extend reserved name check --- lib/rspec/core/memoized_helpers.rb | 16 +++++++++-- spec/rspec/core/memoized_helpers_spec.rb | 35 +++++++++++++++++++++--- 2 files changed, 44 insertions(+), 7 deletions(-) diff --git a/lib/rspec/core/memoized_helpers.rb b/lib/rspec/core/memoized_helpers.rb index 87ee8e9359..0fcbae04c1 100644 --- a/lib/rspec/core/memoized_helpers.rb +++ b/lib/rspec/core/memoized_helpers.rb @@ -307,9 +307,19 @@ def let(name, &block) # We have to pass the block directly to `define_method` to # allow it to use method constructs like `super` and `return`. raise "#let or #subject called without a block" if block.nil? - raise( - "#let or #subject called with a reserved name #initialize" - ) if :initialize == name + + # A list of reserved names that may not be used inside #let or #subject + # Matches for both symbols and passed strings + reserved_helper_names = [:initialize, :to_s] + matching_reserved_name = reserved_helper_names.find do | reserved_name | + reserved_name == name || reserved_name.to_s == name + end + + unless matching_reserved_name.nil? + raise( + "#let or #subject called with reserved name ##{matching_reserved_name.to_s}" + ) + end our_module = MemoizedHelpers.module_for(self) # If we have a module clash in our helper module diff --git a/spec/rspec/core/memoized_helpers_spec.rb b/spec/rspec/core/memoized_helpers_spec.rb index 4987549853..b981a407d0 100644 --- a/spec/rspec/core/memoized_helpers_spec.rb +++ b/spec/rspec/core/memoized_helpers_spec.rb @@ -520,12 +520,39 @@ def count end.to raise_error(/#let or #subject called without a block/) end - it 'raises an error when attempting to define a reserved method name' do - expect do - RSpec.describe { let(:initialize) { true }} - end.to raise_error(/#let or #subject called with a reserved name #initialize/) + context 'when defining a reserved name' do + context 'when name is initialize' do + + it 'raises an error when attempting to define a reserved name #initialize' do + expect do + RSpec.describe { let(:initialize) { true }} + end.to raise_error(/#let or #subject called with reserved name #initialize/) + end + + it 'raises an error when attempting to define a reserved name #initialize as a string' do + expect do + RSpec.describe { let('initialize') { true }} + end.to raise_error(/#let or #subject called with reserved name #initialize/) + end + end + + context 'when name is to_s' do + it 'raises an error when attempting to define a reserved name #to_s' do + expect do + RSpec.describe { let(:to_s) { true }} + end.to raise_error(/#let or #subject called with reserved name #to_s/) + end + + it 'raises an error when attempting to define a reserved name #to_s as a string' do + expect do + RSpec.describe { let('to_s') { true }} + end.to raise_error(/#let or #subject called with reserved name #to_s/) + end + end end + + let(:a_value) { "a string" } context 'when overriding let in a nested context' do From b9087a1f7572f0ccc3bbe96b9eb0b91d31aa5511 Mon Sep 17 00:00:00 2001 From: Liberatys Date: Tue, 20 Apr 2021 21:22:30 +0200 Subject: [PATCH 065/104] Remove duplicate call to to_s --- lib/rspec/core/memoized_helpers.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rspec/core/memoized_helpers.rb b/lib/rspec/core/memoized_helpers.rb index 0fcbae04c1..1e55b30604 100644 --- a/lib/rspec/core/memoized_helpers.rb +++ b/lib/rspec/core/memoized_helpers.rb @@ -317,7 +317,7 @@ def let(name, &block) unless matching_reserved_name.nil? raise( - "#let or #subject called with reserved name ##{matching_reserved_name.to_s}" + "#let or #subject called with reserved name ##{matching_reserved_name}" ) end our_module = MemoizedHelpers.module_for(self) From 425ba72e838e279cd35b808c5f12c5a8657e0b29 Mon Sep 17 00:00:00 2001 From: Liberatys Date: Tue, 20 Apr 2021 21:04:32 +0200 Subject: [PATCH 066/104] Extend reserved name check --- Changelog.md | 1 + lib/rspec/core/memoized_helpers.rb | 12 ++----- spec/rspec/core/memoized_helpers_spec.rb | 45 ++++++++++-------------- 3 files changed, 23 insertions(+), 35 deletions(-) diff --git a/Changelog.md b/Changelog.md index a3bcc69c4a..2fa593c9a4 100644 --- a/Changelog.md +++ b/Changelog.md @@ -5,6 +5,7 @@ Enhancements: * Improve pluralisation of words ending with `s` (like process). (Joshua Pinter, #2779) * Add ordering by file modification time (most recent first). (Matheus Richard, #2778) +* Extend reserved memoized helper name checking for #let and #subject. (Nick Flückiger, #2886) Bug fixes: diff --git a/lib/rspec/core/memoized_helpers.rb b/lib/rspec/core/memoized_helpers.rb index 1e55b30604..adcfce7af3 100644 --- a/lib/rspec/core/memoized_helpers.rb +++ b/lib/rspec/core/memoized_helpers.rb @@ -308,18 +308,12 @@ def let(name, &block) # allow it to use method constructs like `super` and `return`. raise "#let or #subject called without a block" if block.nil? - # A list of reserved names that may not be used inside #let or #subject + # A list of reserved words that can't be used as a name for a memoized helper # Matches for both symbols and passed strings - reserved_helper_names = [:initialize, :to_s] - matching_reserved_name = reserved_helper_names.find do | reserved_name | - reserved_name == name || reserved_name.to_s == name + if [:initialize, :to_s].include?(name.to_sym) + raise ArgumentError, "#let or #subject called with reserved name `#{name}`" end - unless matching_reserved_name.nil? - raise( - "#let or #subject called with reserved name ##{matching_reserved_name}" - ) - end our_module = MemoizedHelpers.module_for(self) # If we have a module clash in our helper module diff --git a/spec/rspec/core/memoized_helpers_spec.rb b/spec/rspec/core/memoized_helpers_spec.rb index b981a407d0..9dc9ed7c98 100644 --- a/spec/rspec/core/memoized_helpers_spec.rb +++ b/spec/rspec/core/memoized_helpers_spec.rb @@ -520,35 +520,28 @@ def count end.to raise_error(/#let or #subject called without a block/) end - context 'when defining a reserved name' do - context 'when name is initialize' do - - it 'raises an error when attempting to define a reserved name #initialize' do - expect do - RSpec.describe { let(:initialize) { true }} - end.to raise_error(/#let or #subject called with reserved name #initialize/) - end + it 'raises an error when attempting to define a reserved name #initialize' do + expect do + RSpec.describe { let(:initialize) { true } } + end.to raise_error(/#let or #subject called with reserved name `initialize`/) + end - it 'raises an error when attempting to define a reserved name #initialize as a string' do - expect do - RSpec.describe { let('initialize') { true }} - end.to raise_error(/#let or #subject called with reserved name #initialize/) - end - end + it 'raises an error when attempting to define a reserved name #initialize as a string' do + expect do + RSpec.describe { let('initialize') { true } } + end.to raise_error(/#let or #subject called with reserved name `initialize`/) + end - context 'when name is to_s' do - it 'raises an error when attempting to define a reserved name #to_s' do - expect do - RSpec.describe { let(:to_s) { true }} - end.to raise_error(/#let or #subject called with reserved name #to_s/) - end + it 'raises an error when attempting to define a reserved name #to_s' do + expect do + RSpec.describe { let(:to_s) { true } } + end.to raise_error(/#let or #subject called with reserved name `to_s`/) + end - it 'raises an error when attempting to define a reserved name #to_s as a string' do - expect do - RSpec.describe { let('to_s') { true }} - end.to raise_error(/#let or #subject called with reserved name #to_s/) - end - end + it 'raises an error when attempting to define a reserved name #to_s as a string' do + expect do + RSpec.describe { let('to_s') { true } } + end.to raise_error(/#let or #subject called with reserved name `to_s`/) end From 8fffd66a764e0972d9f26de83819a90afe8fe9f0 Mon Sep 17 00:00:00 2001 From: Liberatys Date: Tue, 27 Apr 2021 19:52:46 +0200 Subject: [PATCH 067/104] Remove spacing --- spec/rspec/core/memoized_helpers_spec.rb | 2 -- 1 file changed, 2 deletions(-) diff --git a/spec/rspec/core/memoized_helpers_spec.rb b/spec/rspec/core/memoized_helpers_spec.rb index 9dc9ed7c98..35ada394b6 100644 --- a/spec/rspec/core/memoized_helpers_spec.rb +++ b/spec/rspec/core/memoized_helpers_spec.rb @@ -544,8 +544,6 @@ def count end.to raise_error(/#let or #subject called with reserved name `to_s`/) end - - let(:a_value) { "a string" } context 'when overriding let in a nested context' do From 04d5e5264daf51bac0e40573381eaea356737883 Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Wed, 28 Apr 2021 22:20:18 +0100 Subject: [PATCH 068/104] Improve changelog for #2886 --- Changelog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Changelog.md b/Changelog.md index 2fa593c9a4..b66bb1efcc 100644 --- a/Changelog.md +++ b/Changelog.md @@ -5,7 +5,7 @@ Enhancements: * Improve pluralisation of words ending with `s` (like process). (Joshua Pinter, #2779) * Add ordering by file modification time (most recent first). (Matheus Richard, #2778) -* Extend reserved memoized helper name checking for #let and #subject. (Nick Flückiger, #2886) +* Add `to_s` to reserved names for #let and #subject. (Nick Flückiger, #2886) Bug fixes: From 3328169d73fa395c4727ef2dc7311e30bbf63932 Mon Sep 17 00:00:00 2001 From: teyamagu <907019+teyamagu@users.noreply.github.com> Date: Sat, 29 May 2021 00:58:05 +0900 Subject: [PATCH 069/104] fixed format typo in changelog fixed format typo in changelog --- Changelog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Changelog.md b/Changelog.md index b66bb1efcc..fdf6a57e9b 100644 --- a/Changelog.md +++ b/Changelog.md @@ -29,7 +29,7 @@ Enhancements: * Add configuration for an error exit code (to disambiguate errored builds from failed builds by exit status). (Dana Sherson, #2749) -# 3.9.3 / 2020-09-30 +### 3.9.3 / 2020-09-30 [Full Changelog](http://github.com/rspec/rspec-core/compare/v3.9.2...v3.9.3) Bug Fixes: From 92fa4bd9a32af8def193791224cbfb7c6611bde8 Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Wed, 7 Jul 2021 10:30:05 +0100 Subject: [PATCH 070/104] Remove bundler lines from backtraces locally --- spec/integration/spec_file_load_errors_spec.rb | 1 + spec/integration/suite_hooks_errors_spec.rb | 1 + spec/support/formatter_support.rb | 12 +++++++----- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/spec/integration/spec_file_load_errors_spec.rb b/spec/integration/spec_file_load_errors_spec.rb index db897b398d..7289ba1014 100644 --- a/spec/integration/spec_file_load_errors_spec.rb +++ b/spec/integration/spec_file_load_errors_spec.rb @@ -23,6 +23,7 @@ RSpec.configure do |c| c.filter_gems_from_backtrace "gems/aruba" + c.filter_gems_from_backtrace "gems/bundler" c.backtrace_exclusion_patterns << %r{/rspec-core/spec/} << %r{rspec_with_simplecov} c.failure_exit_code = failure_exit_code c.error_exit_code = error_exit_code diff --git a/spec/integration/suite_hooks_errors_spec.rb b/spec/integration/suite_hooks_errors_spec.rb index 9932a54d76..c70bed21eb 100644 --- a/spec/integration/suite_hooks_errors_spec.rb +++ b/spec/integration/suite_hooks_errors_spec.rb @@ -25,6 +25,7 @@ RSpec.configure do |c| c.filter_gems_from_backtrace "gems/aruba" + c.filter_gems_from_backtrace "gems/bundler" c.backtrace_exclusion_patterns << %r{/rspec-core/spec/} << %r{rspec_with_simplecov} c.failure_exit_code = failure_exit_code c.error_exit_code = error_exit_code diff --git a/spec/support/formatter_support.rb b/spec/support/formatter_support.rb index 529d9fb2a6..27809ee665 100644 --- a/spec/support/formatter_support.rb +++ b/spec/support/formatter_support.rb @@ -33,6 +33,7 @@ def run_rspec_with_formatter(formatter, options={}) runner = RSpec::Core::Runner.new(options) configuration = runner.configuration + configuration.filter_gems_from_backtrace "gems/bundler" configuration.backtrace_formatter.exclusion_patterns << /rspec_with_simplecov/ configuration.backtrace_formatter.inclusion_patterns = [] @@ -41,6 +42,7 @@ def run_rspec_with_formatter(formatter, options={}) runner.run(err, out) out.string end + RUN_LINE = __LINE__ - 3 def normalize_durations(output) output.gsub(/(?:\d+ minutes? )?\d+(?:\.\d+)?(s| seconds?)/) do |dur| @@ -67,7 +69,7 @@ def expected_summary_output_for_example_specs | | (compared using ==) | # ./spec/rspec/core/resources/formatter_specs.rb:18 - | # ./spec/support/formatter_support.rb:41:in `run_rspec_with_formatter' + | # ./spec/support/formatter_support.rb:#{RUN_LINE}:in `run_rspec_with_formatter' | # ./spec/support/formatter_support.rb:3:in `run_example_specs_with_formatter' | # ./spec/support/sandboxing.rb:16 | # ./spec/support/sandboxing.rb:7 @@ -87,7 +89,7 @@ def expected_summary_output_for_example_specs | | (compared using ==) | # ./spec/rspec/core/resources/formatter_specs.rb:37 - | # ./spec/support/formatter_support.rb:41:in `run_rspec_with_formatter' + | # ./spec/support/formatter_support.rb:#{RUN_LINE}:in `run_rspec_with_formatter' | # ./spec/support/formatter_support.rb:3:in `run_example_specs_with_formatter' | # ./spec/support/sandboxing.rb:16 | # ./spec/support/sandboxing.rb:7 @@ -162,7 +164,7 @@ def expected_summary_output_for_example_specs | | (compared using ==) | # ./spec/rspec/core/resources/formatter_specs.rb:18:in `block (3 levels) in ' - | # ./spec/support/formatter_support.rb:41:in `run_rspec_with_formatter' + | # ./spec/support/formatter_support.rb:#{RUN_LINE}:in `run_rspec_with_formatter' | # ./spec/support/formatter_support.rb:3:in `run_example_specs_with_formatter' | # ./spec/support/sandboxing.rb:16:in `block (3 levels) in ' | # ./spec/support/sandboxing.rb:7:in `block (2 levels) in ' @@ -182,7 +184,7 @@ def expected_summary_output_for_example_specs | | (compared using ==) | # ./spec/rspec/core/resources/formatter_specs.rb:37:in `block (2 levels) in ' - | # ./spec/support/formatter_support.rb:41:in `run_rspec_with_formatter' + | # ./spec/support/formatter_support.rb:#{RUN_LINE}:in `run_rspec_with_formatter' | # ./spec/support/formatter_support.rb:3:in `run_example_specs_with_formatter' | # ./spec/support/sandboxing.rb:16:in `block (3 levels) in ' | # ./spec/support/sandboxing.rb:7:in `block (2 levels) in ' @@ -213,7 +215,7 @@ def expected_summary_output_for_example_specs | foo | # (erb):1:in `
' | # ./spec/rspec/core/resources/formatter_specs.rb:50:in `block (2 levels) in ' - | # ./spec/support/formatter_support.rb:41:in `run_rspec_with_formatter' + | # ./spec/support/formatter_support.rb:#{RUN_LINE}:in `run_rspec_with_formatter' | # ./spec/support/formatter_support.rb:3:in `run_example_specs_with_formatter' | # ./spec/support/sandboxing.rb:16:in `block (3 levels) in ' | # ./spec/support/sandboxing.rb:7:in `block (2 levels) in ' From ed3e245e57e47babe8854422543023da0f3dcd82 Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Wed, 7 Jul 2021 10:30:27 +0100 Subject: [PATCH 071/104] Make expectations more exact --- spec/rspec/core/formatters/base_text_formatter_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/rspec/core/formatters/base_text_formatter_spec.rb b/spec/rspec/core/formatters/base_text_formatter_spec.rb index bb52318f0d..3a971727b2 100644 --- a/spec/rspec/core/formatters/base_text_formatter_spec.rb +++ b/spec/rspec/core/formatters/base_text_formatter_spec.rb @@ -201,7 +201,7 @@ def run_all_and_dump_failures it "does not show the error class" do group.example("example name") { expect("this").to eq("that") } run_all_and_dump_failures - expect(formatter_output.string).not_to match(/RSpec/m) + expect(formatter_output.string).not_to match(/RSpec::/m) end end @@ -209,7 +209,7 @@ def run_all_and_dump_failures it "does not show the error class" do group.example("example name") { expect("this").to receive("that") } run_all_and_dump_failures - expect(formatter_output.string).not_to match(/RSpec/m) + expect(formatter_output.string).not_to match(/RSpec::/m) end end From 296b8159fa1acdb0e4728323e4aa32a34a620edd Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Wed, 7 Jul 2021 21:33:27 +0100 Subject: [PATCH 072/104] Disable rubocop on ruby head --- script/predicate_functions.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/script/predicate_functions.sh b/script/predicate_functions.sh index e77bdca769..3ff036dd93 100644 --- a/script/predicate_functions.sh +++ b/script/predicate_functions.sh @@ -129,9 +129,13 @@ function documentation_enforced { } function style_and_lint_enforced { - if [ -x ./bin/rubocop ]; then - return 0 - else + if is_ruby_head; then return 1 + else + if [ -x ./bin/rubocop ]; then + return 0 + else + return 1 + fi fi } From fcd6ca442c425e9fee2001921e60efe383e23753 Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Wed, 7 Jul 2021 22:19:47 +0100 Subject: [PATCH 073/104] Update ffi --- Gemfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Gemfile b/Gemfile index cb1c7385e7..f498adc6ab 100644 --- a/Gemfile +++ b/Gemfile @@ -52,8 +52,7 @@ elsif RUBY_VERSION < '2.0' elsif RUBY_VERSION < '2.3.0' gem 'ffi', '~> 1.12.0' else - # Until 1.13.2 is released due to Rubygems usage - gem 'ffi', '~> 1.12.0' + gem 'ffi', '~> 1.15.0' end if RUBY_VERSION < '2.3.0' && !!(RbConfig::CONFIG['host_os'] =~ /cygwin|mswin|mingw|bccwin|wince|emx/) From 20c7482a1dd37f9189017c7bd3659fd78cb757ba Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Tue, 13 Jul 2021 10:25:09 +0100 Subject: [PATCH 074/104] Updated ci build scripts (from rspec-dev)main --- .github/workflows/ci.yml | 9 +++++---- .rubocop_rspec_base.yml | 2 +- script/ci_functions.sh | 2 +- script/clone_all_rspec_repos | 2 +- script/cucumber.sh | 2 +- script/functions.sh | 7 ++----- script/legacy_setup.sh | 2 +- script/predicate_functions.sh | 4 ++-- script/run_build | 2 +- script/update_rubygems_and_install_bundler | 6 +++--- 10 files changed, 18 insertions(+), 20 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 17c14a3eb5..6187690e9f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -# This file was generated on 2021-04-23T09:17:21+01:00 from the rspec-dev repo. +# This file was generated on 2021-07-13T10:25:09+01:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. name: RSpec CI @@ -60,11 +60,12 @@ jobs: - uses: actions/checkout@v2 - uses: ruby/setup-ruby@v1 with: - bundler: ${{ matrix.bundler || 2 }} + bundler: ${{ matrix.bundler || '2.2.22' }} ruby-version: ${{ matrix.ruby }} - run: script/update_rubygems_and_install_bundler - run: script/clone_all_rspec_repos - - run: bundle install --binstubs --standalone + - run: bundle install --standalone + - run: bundle binstubs --all - run: script/run_build legacy: @@ -125,7 +126,7 @@ jobs: - uses: actions/checkout@v2 - uses: ruby/setup-ruby@v1 with: - bundler: 2 + bundler: '2.2.22' ruby-version: ${{ matrix.ruby }} bundler-cache: true - run: cinst ansicon diff --git a/.rubocop_rspec_base.yml b/.rubocop_rspec_base.yml index dbd51b8080..660b7f7d89 100644 --- a/.rubocop_rspec_base.yml +++ b/.rubocop_rspec_base.yml @@ -1,4 +1,4 @@ -# This file was generated on 2021-04-23T09:17:21+01:00 from the rspec-dev repo. +# This file was generated on 2021-07-13T10:25:09+01:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. # This file contains defaults for RSpec projects. Individual projects diff --git a/script/ci_functions.sh b/script/ci_functions.sh index d33106aa97..d12207bc19 100644 --- a/script/ci_functions.sh +++ b/script/ci_functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2021-04-23T09:17:21+01:00 from the rspec-dev repo. +# This file was generated on 2021-07-13T10:25:09+01:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. # Taken from: diff --git a/script/clone_all_rspec_repos b/script/clone_all_rspec_repos index cc9e0c7a8b..7aa0a8d9a1 100755 --- a/script/clone_all_rspec_repos +++ b/script/clone_all_rspec_repos @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2021-04-23T09:17:21+01:00 from the rspec-dev repo. +# This file was generated on 2021-07-13T10:25:09+01:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e diff --git a/script/cucumber.sh b/script/cucumber.sh index 50990e77bc..f53631d7e3 100755 --- a/script/cucumber.sh +++ b/script/cucumber.sh @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2021-04-23T09:17:21+01:00 from the rspec-dev repo. +# This file was generated on 2021-07-13T10:25:09+01:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e diff --git a/script/functions.sh b/script/functions.sh index 9e9d00a0bf..7a7872838a 100644 --- a/script/functions.sh +++ b/script/functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2021-04-23T09:17:21+01:00 from the rspec-dev repo. +# This file was generated on 2021-07-13T10:25:09+01:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" @@ -139,10 +139,7 @@ function check_binstubs { echo " $ bundle binstubs$gems" echo echo " # To binstub all gems" - echo " $ bundle install --binstubs" - echo - echo " # To binstub all gems and avoid loading bundler" - echo " $ bundle install --binstubs --standalone" + echo " $ bundle binstubs --all" fi return $success diff --git a/script/legacy_setup.sh b/script/legacy_setup.sh index ffa0eed436..847dcd5a27 100755 --- a/script/legacy_setup.sh +++ b/script/legacy_setup.sh @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2021-04-23T09:17:21+01:00 from the rspec-dev repo. +# This file was generated on 2021-07-13T10:25:09+01:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e diff --git a/script/predicate_functions.sh b/script/predicate_functions.sh index 3ff036dd93..45462c880a 100644 --- a/script/predicate_functions.sh +++ b/script/predicate_functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2021-04-23T09:17:21+01:00 from the rspec-dev repo. +# This file was generated on 2021-07-13T10:25:09+01:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. function is_mri { @@ -129,7 +129,7 @@ function documentation_enforced { } function style_and_lint_enforced { - if is_ruby_head; then + if is_ruby_head; then return 1 else if [ -x ./bin/rubocop ]; then diff --git a/script/run_build b/script/run_build index 26ba251ec2..48c9892a60 100755 --- a/script/run_build +++ b/script/run_build @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2021-04-23T09:17:21+01:00 from the rspec-dev repo. +# This file was generated on 2021-07-13T10:25:09+01:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e diff --git a/script/update_rubygems_and_install_bundler b/script/update_rubygems_and_install_bundler index 3469174f8b..929895151a 100755 --- a/script/update_rubygems_and_install_bundler +++ b/script/update_rubygems_and_install_bundler @@ -1,13 +1,13 @@ #!/bin/bash -# This file was generated on 2021-04-23T09:17:21+01:00 from the rspec-dev repo. +# This file was generated on 2021-07-13T10:25:09+01:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e source script/functions.sh if is_ruby_23_plus; then - yes | gem update --system - yes | gem install bundler + yes | gem update --system '3.2.22' + yes | gem install bundler -v '2.2.22' else echo "Warning installing older versions of Rubygems / Bundler" gem update --system '2.7.8' From a6ccbffc589422fb0cedc6b79cc3c0b7934ce4ce Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Thu, 15 Jul 2021 10:45:52 +0100 Subject: [PATCH 075/104] Updated ci build scripts (from rspec-dev)main --- .github/workflows/ci.yml | 2 +- .rubocop_rspec_base.yml | 2 +- script/ci_functions.sh | 2 +- script/clone_all_rspec_repos | 2 +- script/cucumber.sh | 2 +- script/functions.sh | 3 ++- script/legacy_setup.sh | 2 +- script/predicate_functions.sh | 2 +- script/run_build | 2 +- script/update_rubygems_and_install_bundler | 2 +- 10 files changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6187690e9f..ea52ddaafa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -# This file was generated on 2021-07-13T10:25:09+01:00 from the rspec-dev repo. +# This file was generated on 2021-07-15T10:45:52+01:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. name: RSpec CI diff --git a/.rubocop_rspec_base.yml b/.rubocop_rspec_base.yml index 660b7f7d89..0adf2f7ca7 100644 --- a/.rubocop_rspec_base.yml +++ b/.rubocop_rspec_base.yml @@ -1,4 +1,4 @@ -# This file was generated on 2021-07-13T10:25:09+01:00 from the rspec-dev repo. +# This file was generated on 2021-07-15T10:45:52+01:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. # This file contains defaults for RSpec projects. Individual projects diff --git a/script/ci_functions.sh b/script/ci_functions.sh index d12207bc19..44f68ac596 100644 --- a/script/ci_functions.sh +++ b/script/ci_functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2021-07-13T10:25:09+01:00 from the rspec-dev repo. +# This file was generated on 2021-07-15T10:45:52+01:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. # Taken from: diff --git a/script/clone_all_rspec_repos b/script/clone_all_rspec_repos index 7aa0a8d9a1..cebc3f7a80 100755 --- a/script/clone_all_rspec_repos +++ b/script/clone_all_rspec_repos @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2021-07-13T10:25:09+01:00 from the rspec-dev repo. +# This file was generated on 2021-07-15T10:45:52+01:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e diff --git a/script/cucumber.sh b/script/cucumber.sh index f53631d7e3..6982d35774 100755 --- a/script/cucumber.sh +++ b/script/cucumber.sh @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2021-07-13T10:25:09+01:00 from the rspec-dev repo. +# This file was generated on 2021-07-15T10:45:52+01:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e diff --git a/script/functions.sh b/script/functions.sh index 7a7872838a..72b4296e04 100644 --- a/script/functions.sh +++ b/script/functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2021-07-13T10:25:09+01:00 from the rspec-dev repo. +# This file was generated on 2021-07-15T10:45:52+01:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" @@ -90,6 +90,7 @@ function run_spec_suite_for { unset BUNDLE_GEMFILE bundle_install_flags=`cat .github/workflows/ci.yml | grep "bundle install" | sed 's/.* bundle install//'` travis_retry eval "(unset RUBYOPT; exec bundle install $bundle_install_flags)" + travis_retry eval "(unset RUBYOPT; exec bundle binstubs --all)" run_specs_and_record_done popd else diff --git a/script/legacy_setup.sh b/script/legacy_setup.sh index 847dcd5a27..9e72d4f5d8 100755 --- a/script/legacy_setup.sh +++ b/script/legacy_setup.sh @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2021-07-13T10:25:09+01:00 from the rspec-dev repo. +# This file was generated on 2021-07-15T10:45:52+01:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e diff --git a/script/predicate_functions.sh b/script/predicate_functions.sh index 45462c880a..415d189127 100644 --- a/script/predicate_functions.sh +++ b/script/predicate_functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2021-07-13T10:25:09+01:00 from the rspec-dev repo. +# This file was generated on 2021-07-15T10:45:52+01:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. function is_mri { diff --git a/script/run_build b/script/run_build index 48c9892a60..794e12ca26 100755 --- a/script/run_build +++ b/script/run_build @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2021-07-13T10:25:09+01:00 from the rspec-dev repo. +# This file was generated on 2021-07-15T10:45:52+01:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e diff --git a/script/update_rubygems_and_install_bundler b/script/update_rubygems_and_install_bundler index 929895151a..26523a607b 100755 --- a/script/update_rubygems_and_install_bundler +++ b/script/update_rubygems_and_install_bundler @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2021-07-13T10:25:09+01:00 from the rspec-dev repo. +# This file was generated on 2021-07-15T10:45:52+01:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e From c56feff78f190b989d0e073114cceaa89a8d4714 Mon Sep 17 00:00:00 2001 From: Zinovyev Ivan Date: Tue, 13 Jul 2021 17:51:29 +0300 Subject: [PATCH 076/104] Do not fail if an Exception has no backtrace Currently `backtrace` of an exception is checked by the `empty?` method. But it sometimes occur that the Exception class will return `nil` for backtrace: ``` StandardError.new.backtrace.empty? NoMethodError: undefined method `empty?' for nil:NilClass ``` --- .../core/formatters/exception_presenter.rb | 2 +- .../formatters/exception_presenter_spec.rb | 36 +++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/lib/rspec/core/formatters/exception_presenter.rb b/lib/rspec/core/formatters/exception_presenter.rb index 9320ff16d7..26757a19a1 100644 --- a/lib/rspec/core/formatters/exception_presenter.rb +++ b/lib/rspec/core/formatters/exception_presenter.rb @@ -55,7 +55,7 @@ def formatted_cause(exception) cause << " #{line}" end - unless last_cause.backtrace.empty? + unless last_cause.backtrace.nil? || last_cause.backtrace.empty? cause << (" #{backtrace_formatter.format_backtrace(last_cause.backtrace, example.metadata).first}") end end diff --git a/spec/rspec/core/formatters/exception_presenter_spec.rb b/spec/rspec/core/formatters/exception_presenter_spec.rb index 199b71c453..92934ac769 100644 --- a/spec/rspec/core/formatters/exception_presenter_spec.rb +++ b/spec/rspec/core/formatters/exception_presenter_spec.rb @@ -202,6 +202,42 @@ def initialize(message, backtrace = [], cause = nil) EOS end + context "when the first exception doesn't have a backgrace" do + let(:first_exception) { FakeException.new("Real\nculprit", backtrace) } + + shared_examples 'expected result for the case when there is no backtrace' do + it 'wont fail for the exception with a nil backtrace', :if => RSpec::Support::RubyFeatures.supports_exception_cause? do + the_presenter = Formatters::ExceptionPresenter.new(the_exception, example) + + expect(the_presenter.fully_formatted(1)).to eq(<<-EOS.gsub(/^ +\|/, '')) + | + | 1) Example + | Failure/Error: # The failure happened here!#{ encoding_check } + | + | Boom + | Bam + | # ./spec/rspec/core/formatters/exception_presenter_spec.rb:#{line_num} + | # ------------------ + | # --- Caused by: --- + | # Real + | # culprit + EOS + end + end + + context 'when backtrace is []' do + let(:backtrace) { [] } + + it_behaves_like 'expected result for the case when there is no backtrace' + end + + context 'when backtrace is nil' do + let(:backtrace) { nil } + + it_behaves_like 'expected result for the case when there is no backtrace' + end + end + it 'wont produce a stack error when cause is the exception itself', :if => RSpec::Support::RubyFeatures.supports_exception_cause? do allow(the_exception).to receive(:cause) { the_exception } the_presenter = Formatters::ExceptionPresenter.new(the_exception, example) From c30348ce5df94f4b44d6a257bacab69bd2270fb4 Mon Sep 17 00:00:00 2001 From: Phil Pirozhkov Date: Fri, 16 Jul 2021 21:38:16 +0300 Subject: [PATCH 077/104] Add Changelog entry --- Changelog.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Changelog.md b/Changelog.md index fdf6a57e9b..1fd2766623 100644 --- a/Changelog.md +++ b/Changelog.md @@ -10,6 +10,8 @@ Enhancements: Bug fixes: * Ensure bisect communication uses consistent encoding. (Mike Jarema, #2852) +* Fix exception presenter when the root cause exception has nil backtrace. + (Zinovyev Ivan, #2903) ### 3.10.1 / 2020-12-27 [Full Changelog](http://github.com/rspec/rspec-core/compare/v3.10.0...v3.10.1) From dc898adc3f98d841a43e22cdf62ae2250266c7b6 Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Wed, 28 Jul 2021 10:30:30 +0100 Subject: [PATCH 078/104] Bump rake minimum version to avoid CVE-2020-8130 --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index f498adc6ab..9e95b7753d 100644 --- a/Gemfile +++ b/Gemfile @@ -17,7 +17,7 @@ if RUBY_VERSION < '1.9.3' elsif RUBY_VERSION < '2.0.0' gem 'rake', '< 12.0.0' # rake 12 requires Ruby 2.0.0 or later else - gem 'rake', '> 12.3.2' + gem 'rake', '>= 12.3.3' end if ENV['DIFF_LCS_VERSION'] From dc3dda1ce0c79c488a527debb5c35110b968b430 Mon Sep 17 00:00:00 2001 From: Odin H B Date: Tue, 15 Jun 2021 19:18:59 +0200 Subject: [PATCH 079/104] Implement RSpec.current_scope My reasoning is: rspec-rails needs to do the following condition: `if RSpec.current_scope == :before_context_hook` test_prof needs to do the following condition: `if RSpec.current_scope == :before_context_hook` amd my little helper needs the following `unless [:before_example_hook, :example].include?(RSpec.current_scope)` --- .rubocop.yml | 2 +- Changelog.md | 2 + features/metadata/current_scope.feature | 87 +++++++++++++++++++++++++ lib/rspec/core.rb | 26 ++++++++ lib/rspec/core/configuration.rb | 3 + lib/rspec/core/example.rb | 3 + lib/rspec/core/example_group.rb | 2 + spec/rspec/core_spec.rb | 14 ++++ 8 files changed, 138 insertions(+), 1 deletion(-) create mode 100644 features/metadata/current_scope.feature diff --git a/.rubocop.yml b/.rubocop.yml index 29d6341570..9a3abf924a 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -24,7 +24,7 @@ Metrics/LineLength: # This should go down over time. Metrics/MethodLength: - Max: 37 + Max: 39 # This should go down over time. Metrics/CyclomaticComplexity: diff --git a/Changelog.md b/Changelog.md index fdf6a57e9b..2c62bfded9 100644 --- a/Changelog.md +++ b/Changelog.md @@ -6,6 +6,8 @@ Enhancements: * Improve pluralisation of words ending with `s` (like process). (Joshua Pinter, #2779) * Add ordering by file modification time (most recent first). (Matheus Richard, #2778) * Add `to_s` to reserved names for #let and #subject. (Nick Flückiger, #2886) +* Introduce `RSpec.current_scope` to expose the current scope in which + RSpec is executing. e.g. `:before_example_hook`, `:example` etc. (@odinhb, #2895) Bug fixes: diff --git a/features/metadata/current_scope.feature b/features/metadata/current_scope.feature new file mode 100644 index 0000000000..4dacd710ef --- /dev/null +++ b/features/metadata/current_scope.feature @@ -0,0 +1,87 @@ +Feature: RSpec provides the current scope as RSpec.current_scope + + You can detect which rspec scope your helper methods or library code is executing in. + This is useful if for example, your method only makes sense to call in a certain context. + + Scenario: Detecting the current scope + Given a file named "current_scope_spec.rb" with: + """ruby + # Outside of the test lifecycle, the current scope is `:suite` + exit(1) unless RSpec.current_scope == :suite + + at_exit do + exit(1) unless RSpec.current_scope == :suite + end + + RSpec.configure do |c| + c.before :suite do + expect(RSpec.current_scope).to eq(:before_suite_hook) + end + + c.before :context do + expect(RSpec.current_scope).to eq(:before_context_hook) + end + + c.before :example do + expect(RSpec.current_scope).to eq(:before_example_hook) + end + + c.around :example do |ex| + expect(RSpec.current_scope).to eq(:before_example_hook) + ex.run + expect(RSpec.current_scope).to eq(:after_example_hook) + end + + c.after :example do + expect(RSpec.current_scope).to eq(:after_example_hook) + end + + c.after :context do + expect(RSpec.current_scope).to eq(:after_context_hook) + end + + c.after :suite do + expect(RSpec.current_scope).to eq(:after_suite_hook) + end + end + + RSpec.describe "RSpec.current_scope" do + before :context do + expect(RSpec.current_scope).to eq(:before_context_hook) + end + + before :example do + expect(RSpec.current_scope).to eq(:before_example_hook) + end + + around :example do |ex| + expect(RSpec.current_scope).to eq(:before_example_hook) + ex.run + expect(RSpec.current_scope).to eq(:after_example_hook) + end + + after :example do + expect(RSpec.current_scope).to eq(:after_example_hook) + end + + after :context do + expect(RSpec.current_scope).to eq(:after_context_hook) + end + + it "is :example in an example" do + expect(RSpec.current_scope).to eq(:example) + end + + it "works for multiple examples" do + expect(RSpec.current_scope).to eq(:example) + end + + describe "in nested describe blocks" do + it "still works" do + expect(RSpec.current_scope).to eq(:example) + end + end + end + """ + When I run `rspec current_scope_spec.rb` + Then the examples should all pass diff --git a/lib/rspec/core.rb b/lib/rspec/core.rb index 2f10014b2e..ad9553c9bd 100644 --- a/lib/rspec/core.rb +++ b/lib/rspec/core.rb @@ -129,6 +129,32 @@ def self.current_example=(example) RSpec::Support.thread_local_data[:current_example] = example end + # Set the current scope rspec is executing in + # @api private + def self.current_scope=(scope) + RSpec::Support.thread_local_data[:current_scope] = scope + end + RSpec.current_scope = :suite + + # Get the current RSpec execution scope + # + # Returns (in order of lifecycle): + # * `:suite` as an initial value, this is outside of the test lifecycle. + # * `:before_suite_hook` during `before(:suite)` hooks. + # * `:before_context_hook` during `before(:context)` hooks. + # * `:before_example_hook` during `before(:example)` hooks and `around(:example)` before `example.run`. + # * `:example` within the example run. + # * `:after_example_hook` during `after(:example)` hooks and `around(:example)` after `example.run`. + # * `:after_context_hook` during `after(:context)` hooks. + # * `:after_suite_hook` during `after(:suite)` hooks. + # * `:suite` as a final value, again this is outside of the test lifecycle. + # + # Reminder, `:context` hooks have `:all` alias and `:example` hooks have `:each` alias. + # @return [Symbol] + def self.current_scope + RSpec::Support.thread_local_data[:current_scope] + end + # @private # Internal container for global non-configuration data. def self.world diff --git a/lib/rspec/core/configuration.rb b/lib/rspec/core/configuration.rb index bb38a8de4f..399ae15d6c 100644 --- a/lib/rspec/core/configuration.rb +++ b/lib/rspec/core/configuration.rb @@ -2063,10 +2063,13 @@ def with_suite_hooks return yield if dry_run? begin + RSpec.current_scope = :before_suite_hook run_suite_hooks("a `before(:suite)` hook", @before_suite_hooks) yield ensure + RSpec.current_scope = :after_suite_hook run_suite_hooks("an `after(:suite)` hook", @after_suite_hooks) + RSpec.current_scope = :suite end end diff --git a/lib/rspec/core/example.rb b/lib/rspec/core/example.rb index d3b891fa92..eb061ee8fa 100644 --- a/lib/rspec/core/example.rb +++ b/lib/rspec/core/example.rb @@ -259,6 +259,7 @@ def run(example_group_instance, reporter) with_around_and_singleton_context_hooks do begin run_before_example + RSpec.current_scope = :example @example_group_instance.instance_exec(self, &@example_block) if pending? @@ -278,6 +279,7 @@ def run(example_group_instance, reporter) rescue AllExceptionsExcludingDangerousOnesOnRubiesThatAllowIt => e set_exception(e) ensure + RSpec.current_scope = :after_example_hook run_after_example end end @@ -462,6 +464,7 @@ def hooks end def with_around_example_hooks + RSpec.current_scope = :before_example_hook hooks.run(:around, :example, self) { yield } rescue Support::AllExceptionsExceptOnesWeMustNotRescue => e set_exception(e) diff --git a/lib/rspec/core/example_group.rb b/lib/rspec/core/example_group.rb index 5efee9f386..8a2d7cb381 100644 --- a/lib/rspec/core/example_group.rb +++ b/lib/rspec/core/example_group.rb @@ -602,6 +602,7 @@ def self.run(reporter=RSpec::Core::NullReporter) should_run_context_hooks = descendant_filtered_examples.any? begin + RSpec.current_scope = :before_context_hook run_before_context_hooks(new('before(:context) hook')) if should_run_context_hooks result_for_this_group = run_examples(reporter) results_for_descendants = ordering_strategy.order(children).map { |child| child.run(reporter) }.all? @@ -614,6 +615,7 @@ def self.run(reporter=RSpec::Core::NullReporter) RSpec.world.wants_to_quit = true if reporter.fail_fast_limit_met? false ensure + RSpec.current_scope = :after_context_hook run_after_context_hooks(new('after(:context) hook')) if should_run_context_hooks reporter.example_group_finished(self) end diff --git a/spec/rspec/core_spec.rb b/spec/rspec/core_spec.rb index 085acbbbab..d9a02e97e7 100644 --- a/spec/rspec/core_spec.rb +++ b/spec/rspec/core_spec.rb @@ -129,6 +129,20 @@ end end + describe ".current_scope" do + before :context do + expect(RSpec.current_scope).to eq(:before_context_hook) + end + + before do + expect(RSpec.current_scope).to eq(:before_example_hook) + end + + it "returns :example inside an example" do + expect(RSpec.current_scope).to eq(:example) + end + end + describe ".reset" do it "resets the configuration and world objects" do config_before_reset = RSpec.configuration From 94dfb29265fbadb1216a0aaf97cd343396c942c3 Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Sat, 14 Aug 2021 20:46:01 +0100 Subject: [PATCH 080/104] Remove white space --- features/metadata/current_scope.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/metadata/current_scope.feature b/features/metadata/current_scope.feature index 4dacd710ef..6df122d449 100644 --- a/features/metadata/current_scope.feature +++ b/features/metadata/current_scope.feature @@ -7,7 +7,7 @@ Feature: RSpec provides the current scope as RSpec.current_scope Given a file named "current_scope_spec.rb" with: """ruby # Outside of the test lifecycle, the current scope is `:suite` - exit(1) unless RSpec.current_scope == :suite + exit(1) unless RSpec.current_scope == :suite at_exit do exit(1) unless RSpec.current_scope == :suite From 3b7115339e025aa048b2bfb31563b2c41e06ae5b Mon Sep 17 00:00:00 2001 From: githubuseracct Date: Mon, 20 Sep 2021 17:11:17 -0400 Subject: [PATCH 081/104] Add support for bold colors --- .../formatters/configurable_colors.feature | 22 +++++++++++++++- .../step_definitions/additional_cli_steps.rb | 10 +++++-- lib/rspec/core/formatters/console_codes.rb | 26 ++++++++++++------- .../core/formatters/console_codes_spec.rb | 24 +++++++++++++++++ 4 files changed, 70 insertions(+), 12 deletions(-) diff --git a/features/formatters/configurable_colors.feature b/features/formatters/configurable_colors.feature index 366ad461d9..e5ca1c12f5 100644 --- a/features/formatters/configurable_colors.feature +++ b/features/formatters/configurable_colors.feature @@ -10,7 +10,9 @@ Feature: Configurable colors * `detail_color`: Color used for miscellaneous test details (default: `:cyan`) Colors are specified as symbols. Options are `:black`, `:red`, `:green`, - `:yellow`, `:blue`, `:magenta`, `:cyan`, and `:white`. + `:yellow`, `:blue`, `:magenta`, `:cyan`, `:white`, `:bold_black`, `:bold_red`, + `:bold_green`, `:bold_yellow`, `:bold_blue`, `:bold_magenta`, `:bold_cyan`, + and `:bold_white`, @keep-ansi-escape-sequences Scenario: Customizing the failure color @@ -29,3 +31,21 @@ Feature: Configurable colors """ When I run `rspec custom_failure_color_spec.rb --format progress` Then the failing example is printed in magenta + + @keep-ansi-escape-sequences + Scenario: Customizing the failure color with a custom console code + Given a file named "custom_failure_color_spec.rb" with: + """ruby + RSpec.configure do |config| + config.failure_color = "1;32" + config.color_mode = :on + end + + RSpec.describe "failure" do + it "fails and uses the custom color" do + expect(2).to eq(4) + end + end + """ + When I run `rspec custom_failure_color_spec.rb --format progress` + Then the failing example is printed wrapped in "1;32" diff --git a/features/step_definitions/additional_cli_steps.rb b/features/step_definitions/additional_cli_steps.rb index f1a3dc0037..73bd6467a9 100644 --- a/features/step_definitions/additional_cli_steps.rb +++ b/features/step_definitions/additional_cli_steps.rb @@ -76,10 +76,16 @@ end # This step can be generalized if it's ever used to test other colors -Then /^the failing example is printed in magenta$/ do +Then /^the failing example is printed (?:wrapped )?in (.*)$/ do |color| + code = + case color + when "magenta" then "\e[35m" + when /"(.*)"/ then "\e[#{$1}m" + end + # \e[35m = enable magenta # \e[0m = reset colors - expect(all_output).to include("\e[35m" + "F" + "\e[0m") + expect(all_output).to include(code + "F" + "\e[0m") end Then /^the output from `([^`]+)` should contain "(.*?)"$/ do |cmd, expected_output| diff --git a/lib/rspec/core/formatters/console_codes.rb b/lib/rspec/core/formatters/console_codes.rb index be2ee549b6..79e3062682 100644 --- a/lib/rspec/core/formatters/console_codes.rb +++ b/lib/rspec/core/formatters/console_codes.rb @@ -7,15 +7,23 @@ module ConsoleCodes # @private VT100_CODES = { - :black => 30, - :red => 31, - :green => 32, - :yellow => 33, - :blue => 34, - :magenta => 35, - :cyan => 36, - :white => 37, - :bold => 1, + :black => 30, + :red => 31, + :green => 32, + :yellow => 33, + :blue => 34, + :magenta => 35, + :cyan => 36, + :white => 37, + :bold_black => '1;30', + :bold_red => '1;31', + :bold_green => '1;32', + :bold_yellow => '1;33', + :bold_blue => '1;34', + :bold_magenta => '1;35', + :bold_cyan => '1;36', + :bold_white => '1;37', + :bold => 1, } # @private VT100_CODE_VALUES = VT100_CODES.invert diff --git a/spec/rspec/core/formatters/console_codes_spec.rb b/spec/rspec/core/formatters/console_codes_spec.rb index 04a9c7d830..ff96946131 100644 --- a/spec/rspec/core/formatters/console_codes_spec.rb +++ b/spec/rspec/core/formatters/console_codes_spec.rb @@ -10,6 +10,12 @@ end end + context "when given a VT100 compound code" do + it "returns the code" do + expect(console_codes.console_code_for('1;32')).to eq '1;32' + end + end + context "when given a symbolic name" do it "returns the code" do expect(console_codes.console_code_for(:green)).to eq 32 @@ -41,12 +47,24 @@ end end + context "when given a VT100 compound code" do + it "formats the text with it" do + expect(console_codes.wrap('abc', '1;32')).to eq "\e[1;32mabc\e[0m" + end + end + context "when given a symbolic color name" do it "translates it to the correct integer code and formats the text with it" do expect(console_codes.wrap('abc', :green)).to eq "\e[32mabc\e[0m" end end + context "when given a symbolic bold color name" do + it "translates it to the correct integer code and formats the text with it" do + expect(console_codes.wrap('abc', :bold_green)).to eq "\e[1;32mabc\e[0m" + end + end + context "when given an rspec code" do it "returns the console code" do RSpec.configuration.success_color = :blue # blue is 34 @@ -54,6 +72,12 @@ end end + context "when given a compound rspec code" do + it "returns the console code" do + RSpec.configuration.success_color = :bold_blue # blue is 34 + expect(console_codes.wrap('abc', :success)).to eq "\e[1;34mabc\e[0m" + end + end context "when given :bold" do it "formats the text as bold" do From 053fcfeb6b0b6627edf7261737553a6f7df8cc14 Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Fri, 24 Sep 2021 21:58:25 +0100 Subject: [PATCH 082/104] Changelog for #2913 --- Changelog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Changelog.md b/Changelog.md index 73c52862c6..25959e285f 100644 --- a/Changelog.md +++ b/Changelog.md @@ -8,6 +8,7 @@ Enhancements: * Add `to_s` to reserved names for #let and #subject. (Nick Flückiger, #2886) * Introduce `RSpec.current_scope` to expose the current scope in which RSpec is executing. e.g. `:before_example_hook`, `:example` etc. (@odinhb, #2895) +* Add named bold colours as options for custom colours. (#2913, #2914) Bug fixes: From 85b7eb72912bc1d80cf236a416f9170789ccb049 Mon Sep 17 00:00:00 2001 From: Keiko Kaneko Date: Sat, 16 Oct 2021 14:27:28 +0900 Subject: [PATCH 083/104] Make the same as class name of Example::Procsy --- lib/rspec/core/example.rb | 2 +- spec/rspec/core/hooks_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/rspec/core/example.rb b/lib/rspec/core/example.rb index eb061ee8fa..4e7618b755 100644 --- a/lib/rspec/core/example.rb +++ b/lib/rspec/core/example.rb @@ -377,7 +377,7 @@ def executed? # @private def inspect - @example.inspect.gsub('Example', 'ExampleProcsy') + @example.inspect.gsub('Example', 'Example::Procsy') end end diff --git a/spec/rspec/core/hooks_spec.rb b/spec/rspec/core/hooks_spec.rb index 895de436ca..3f752ef3eb 100644 --- a/spec/rspec/core/hooks_spec.rb +++ b/spec/rspec/core/hooks_spec.rb @@ -325,7 +325,7 @@ def self.data_from(ex) end group.run - expect(inspect_value).to match(/ExampleProcsy/) + expect(inspect_value).to match(/Example::Procsy/) end end From d57c371ee92b16211b80ac7b0b025968438f5297 Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Sun, 17 Oct 2021 21:37:17 +0100 Subject: [PATCH 084/104] Changelog for #2915 --- Changelog.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Changelog.md b/Changelog.md index 25959e285f..62f23c60a6 100644 --- a/Changelog.md +++ b/Changelog.md @@ -15,6 +15,8 @@ Bug fixes: * Ensure bisect communication uses consistent encoding. (Mike Jarema, #2852) * Fix exception presenter when the root cause exception has nil backtrace. (Zinovyev Ivan, #2903) +* Fix `inspect` output of `RSpec::Core::Example::Procsy` to namespace correctly. + (Keiko Kaneko, #2915) ### 3.10.1 / 2020-12-27 [Full Changelog](http://github.com/rspec/rspec-core/compare/v3.10.0...v3.10.1) From 6ed9d68907bae7f4804eb06e0e0e295497ceb032 Mon Sep 17 00:00:00 2001 From: Yuji Nakayama Date: Sat, 12 Jun 2021 01:35:52 +0900 Subject: [PATCH 085/104] Add SnippetExtractor spec examples for end-less methods support Ref: https://github.com/rspec/rspec-core/issues/2892 --- .../core/formatters/snippet_extractor_spec.rb | 60 +++++++++++++++++++ spec/support/aruba_support.rb | 10 +--- spec/support/helper_methods.rb | 7 +++ 3 files changed, 70 insertions(+), 7 deletions(-) diff --git a/spec/rspec/core/formatters/snippet_extractor_spec.rb b/spec/rspec/core/formatters/snippet_extractor_spec.rb index 32032240ab..406c025ebd 100644 --- a/spec/rspec/core/formatters/snippet_extractor_spec.rb +++ b/spec/rspec/core/formatters/snippet_extractor_spec.rb @@ -1,7 +1,11 @@ require 'rspec/core/formatters/snippet_extractor' +require 'support/helper_methods' +require 'tempfile' module RSpec::Core::Formatters RSpec.describe SnippetExtractor do + include RSpecHelpers + subject(:expression_lines) do SnippetExtractor.extract_expression_lines_at(file_path, line_number, max_line_count) end @@ -182,6 +186,62 @@ def obj.foo(arg) end end + context 'when the expression line includes an "end"-less method definition', :if => RUBY_VERSION.to_f >= 3.0 do + include RSpec::Support::InSubProcess + + let(:source) do + in_sub_process do + load(file.path) + end + end + + let(:file) do + file = Tempfile.new('source.rb') + + file.write(unindent(<<-END)) + obj = Object.new + + def obj.foo = raise + + obj.foo + END + + file.close + + file + end + + after do + file.unlink + end + + it 'returns only the line' do + expect(expression_lines).to eq([ + 'def obj.foo = raise' + ]) + end + end + + context 'when the expression is a setter method definition', :unless => argument_error_points_invoker do + let(:source) do + obj = Object.new + + def obj.foo=(arg1, arg2) + @foo = arg1 + end + + obj.foo = 1 + end + + it 'returns all the lines without confusing it with "end"-less method' do + expect(expression_lines).to eq([ + ' def obj.foo=(arg1, arg2)', + ' @foo = arg1', + ' end' + ]) + end + end + context "when the expression ends with multiple paren-only lines of same type" do let(:source) do do_something_fail(:foo, (:bar diff --git a/spec/support/aruba_support.rb b/spec/support/aruba_support.rb index 5f8383f2db..00d4a74316 100644 --- a/spec/support/aruba_support.rb +++ b/spec/support/aruba_support.rb @@ -1,3 +1,5 @@ +require 'support/helper_methods' + if RSpec::Support::Ruby.jruby? && RSpec::Support::Ruby.jruby_version == "9.1.17.0" # A regression appeared in require_relative in JRuby 9.1.17.0 where require some # how ends up private, this monkey patch uses `send` @@ -29,6 +31,7 @@ module ArubaLoader RSpec.shared_context "aruba support" do include Aruba::Api + include RSpecHelpers let(:stderr) { StringIO.new } let(:stdout) { StringIO.new } @@ -70,13 +73,6 @@ def write_file_formatted(file_name, contents) formatted_contents = unindent(contents.sub(/\A\n/, "")) write_file file_name, formatted_contents end - - # Intended for use with indented heredocs. - # taken from Ruby Tapas: - # https://rubytapas.dpdcart.com/subscriber/post?id=616#files - def unindent(s) - s.gsub(/^#{s.scan(/^[ \t]+(?=\S)/).min}/, "") - end end RSpec.configure do |c| diff --git a/spec/support/helper_methods.rb b/spec/support/helper_methods.rb index c4a7027b85..8de71dc0bd 100644 --- a/spec/support/helper_methods.rb +++ b/spec/support/helper_methods.rb @@ -14,6 +14,13 @@ def ignoring_warnings result end + # Intended for use with indented heredocs. + # taken from Ruby Tapas: + # https://rubytapas.dpdcart.com/subscriber/post?id=616#files + def unindent(s) + s.gsub(/^#{s.scan(/^[ \t]+(?=\S)/).min}/, "") + end + # In Ruby 2.7 taint was removed and has no effect, whilst SAFE warns that it # has no effect and will become a normal varible in 3.0. Other engines do not # implement SAFE. From 96f1b8a38881cfbf43538625b9650e36b7347b96 Mon Sep 17 00:00:00 2001 From: Peter Wall <47324121+p-wall@users.noreply.github.com> Date: Wed, 3 Nov 2021 12:04:36 +0100 Subject: [PATCH 086/104] Update links to use https And update a dead link to use an archived version --- lib/rspec/core/project_initializer/spec/spec_helper.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/rspec/core/project_initializer/spec/spec_helper.rb b/lib/rspec/core/project_initializer/spec/spec_helper.rb index 251aa51060..07bdf4726a 100644 --- a/lib/rspec/core/project_initializer/spec/spec_helper.rb +++ b/lib/rspec/core/project_initializer/spec/spec_helper.rb @@ -12,7 +12,7 @@ # the additional setup, and require it from the spec files that actually need # it. # -# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration +# See https://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration RSpec.configure do |config| # rspec-expectations config goes here. You can use an alternate # assertion/expectation library such as wrong or the stdlib/minitest @@ -61,9 +61,9 @@ # Limits the available syntax to the non-monkey patched syntax that is # recommended. For more details, see: - # - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/ - # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/ - # - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode + # - https://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/ + # - https://web.archive.org/web/20201111222326/http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/ + # - https://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode config.disable_monkey_patching! # This setting enables warnings. It's recommended, but in some cases may From 8b84d35d8d23893a5c65cda8f020915a5a4194ee Mon Sep 17 00:00:00 2001 From: Olle Jonsson Date: Wed, 3 Nov 2021 13:27:50 +0100 Subject: [PATCH 087/104] fix: use Relish link to disable_monkey_patching This avoids old content getting older as time goes by. --- lib/rspec/core/project_initializer/spec/spec_helper.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/rspec/core/project_initializer/spec/spec_helper.rb b/lib/rspec/core/project_initializer/spec/spec_helper.rb index 07bdf4726a..5ae5b6962c 100644 --- a/lib/rspec/core/project_initializer/spec/spec_helper.rb +++ b/lib/rspec/core/project_initializer/spec/spec_helper.rb @@ -61,9 +61,7 @@ # Limits the available syntax to the non-monkey patched syntax that is # recommended. For more details, see: - # - https://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/ - # - https://web.archive.org/web/20201111222326/http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/ - # - https://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode + # https://relishapp.com/rspec/rspec-core/docs/configuration/zero-monkey-patching-mode config.disable_monkey_patching! # This setting enables warnings. It's recommended, but in some cases may From d7b9f9c2631730952bbbcdbfcaad9be1b56ce6e7 Mon Sep 17 00:00:00 2001 From: niceking Date: Fri, 29 Oct 2021 12:04:43 +1300 Subject: [PATCH 088/104] skip output check if output not defined on formatter --- lib/rspec/core/formatters.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/rspec/core/formatters.rb b/lib/rspec/core/formatters.rb index 8ca9112b8a..f0238f85cd 100644 --- a/lib/rspec/core/formatters.rb +++ b/lib/rspec/core/formatters.rb @@ -194,10 +194,16 @@ def register(formatter, notifications) def duplicate_formatter_exists?(new_formatter) @formatters.any? do |formatter| - formatter.class == new_formatter.class && formatter.output == new_formatter.output + formatter.class == new_formatter.class && + has_matching_output?(formatter, new_formatter) end end + def has_matching_output?(formatter, new_formatter) + return true unless formatter.respond_to?(:output) && new_formatter.respond_to?(:output) + formatter.output == new_formatter.output + end + def existing_formatter_implements?(notification) @reporter.registered_listeners(notification).any? end From c9cefaf4104428c7f07e44add90562f08eb7c937 Mon Sep 17 00:00:00 2001 From: niceking Date: Fri, 5 Nov 2021 11:17:09 +1300 Subject: [PATCH 089/104] add spec for output check --- spec/rspec/core/formatters_spec.rb | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/spec/rspec/core/formatters_spec.rb b/spec/rspec/core/formatters_spec.rb index 06c9bb664e..219e505934 100644 --- a/spec/rspec/core/formatters_spec.rb +++ b/spec/rspec/core/formatters_spec.rb @@ -144,6 +144,28 @@ module RSpec::Core::Formatters loader.add :documentation, path }.to change { loader.formatters.length } end + + context "formatters do not subclass BaseFormatter" do + before do + stub_const("CustomFormatter", Class.new) + stub_const("OtherCustomFormatter", Class.new) + Loader.formatters[CustomFormatter] = [] + Loader.formatters[OtherCustomFormatter] = [] + loader.add "CustomFormatter" + end + + it "adds different formatters" do + expect { + loader.add "OtherCustomFormatter" + }.to change { loader.formatters.length } + end + + it "doesn't add the same formatter" do + expect { + loader.add "CustomFormatter" + }.not_to change { loader.formatters.length } + end + end end context "When a custom formatter exists" do From 50f7fb26ed78a504090cc6852e1e82e98d944e94 Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Sat, 6 Nov 2021 08:56:14 +0000 Subject: [PATCH 090/104] Isolate require tempfile --- spec/rspec/core/formatters/snippet_extractor_spec.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/spec/rspec/core/formatters/snippet_extractor_spec.rb b/spec/rspec/core/formatters/snippet_extractor_spec.rb index 406c025ebd..2bc796a8d6 100644 --- a/spec/rspec/core/formatters/snippet_extractor_spec.rb +++ b/spec/rspec/core/formatters/snippet_extractor_spec.rb @@ -1,6 +1,5 @@ require 'rspec/core/formatters/snippet_extractor' require 'support/helper_methods' -require 'tempfile' module RSpec::Core::Formatters RSpec.describe SnippetExtractor do @@ -189,6 +188,11 @@ def obj.foo(arg) context 'when the expression line includes an "end"-less method definition', :if => RUBY_VERSION.to_f >= 3.0 do include RSpec::Support::InSubProcess + around(:example) do |example| + require 'tempfile' + example.call + end + let(:source) do in_sub_process do load(file.path) From d562c2707dc1f264d714dcfb419b7f14ca87f526 Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Fri, 10 Dec 2021 18:25:42 +0000 Subject: [PATCH 091/104] Add formatter spec using real classes --- spec/rspec/core/formatters_spec.rb | 32 +++++++++++++----------------- 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/spec/rspec/core/formatters_spec.rb b/spec/rspec/core/formatters_spec.rb index 219e505934..aee305da97 100644 --- a/spec/rspec/core/formatters_spec.rb +++ b/spec/rspec/core/formatters_spec.rb @@ -145,30 +145,26 @@ module RSpec::Core::Formatters }.to change { loader.formatters.length } end - context "formatters do not subclass BaseFormatter" do - before do - stub_const("CustomFormatter", Class.new) - stub_const("OtherCustomFormatter", Class.new) - Loader.formatters[CustomFormatter] = [] - Loader.formatters[OtherCustomFormatter] = [] - loader.add "CustomFormatter" - end + plain_old_formatter = Class.new do + RSpec::Core::Formatters.register self, :example_started - it "adds different formatters" do - expect { - loader.add "OtherCustomFormatter" - }.to change { loader.formatters.length } + def initialize(output) end + end - it "doesn't add the same formatter" do - expect { - loader.add "CustomFormatter" - }.not_to change { loader.formatters.length } - end + it "handles formatters which do not subclass our formatters" do + expect { + loader.add plain_old_formatter, output + }.to change { loader.formatters.length } + + # deliberate duplicate to ensure we can check for them correctly + expect { + loader.add plain_old_formatter, output + }.to_not change { loader.formatters.length } end end - context "When a custom formatter exists" do + context "when a custom formatter exists" do specific_formatter = RSpec::Core::Formatters::JsonFormatter generic_formatter = specific_formatter.superclass From cf5e292dad5a8c6c5665b1012aee231b5a756638 Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Fri, 10 Dec 2021 23:13:37 +0000 Subject: [PATCH 092/104] Fix build by marking methods as undoced --- lib/rspec/core/example_group.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/rspec/core/example_group.rb b/lib/rspec/core/example_group.rb index 8a2d7cb381..a434f07601 100644 --- a/lib/rspec/core/example_group.rb +++ b/lib/rspec/core/example_group.rb @@ -703,6 +703,7 @@ def self.each_instance_variable_for_example(group) end end + # @private def initialize(inspect_output=nil) @__inspect_output = inspect_output || '(no description provided)' super() # no args get passed @@ -784,6 +785,7 @@ class SharedExampleGroupInclusionStackFrame # @return [String] the location where the shared example was included attr_reader :inclusion_location + # @private def initialize(shared_group_name, inclusion_location) @shared_group_name = shared_group_name @inclusion_location = inclusion_location From e3bda9da1e625a428fd005f0d1a633531f5da749 Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Fri, 10 Dec 2021 23:36:00 +0000 Subject: [PATCH 093/104] Changelog for #2916 --- Changelog.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Changelog.md b/Changelog.md index 62f23c60a6..2b08c7cd1c 100644 --- a/Changelog.md +++ b/Changelog.md @@ -17,6 +17,8 @@ Bug fixes: (Zinovyev Ivan, #2903) * Fix `inspect` output of `RSpec::Core::Example::Procsy` to namespace correctly. (Keiko Kaneko, #2915) +* Ensure formatters not exposing `#output` will not crash duplicate check. + (@niceking, #2916) ### 3.10.1 / 2020-12-27 [Full Changelog](http://github.com/rspec/rspec-core/compare/v3.10.0...v3.10.1) From 26727c3ed1710e2022d290b3617e8dd0e9aa37a7 Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Mon, 10 Jan 2022 22:24:10 +0000 Subject: [PATCH 094/104] Updated ci build scripts (from rspec-dev)main --- .github/workflows/ci.yml | 17 ++++++++++++++++- .rubocop_rspec_base.yml | 2 +- script/ci_functions.sh | 2 +- script/clone_all_rspec_repos | 2 +- script/cucumber.sh | 2 +- script/functions.sh | 2 +- script/legacy_setup.sh | 2 +- script/predicate_functions.sh | 17 +++++++++++++++-- script/run_build | 6 +----- script/run_rubocop | 14 ++++++++++++++ script/update_rubygems_and_install_bundler | 2 +- 11 files changed, 53 insertions(+), 15 deletions(-) create mode 100755 script/run_rubocop diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ea52ddaafa..1d5de7f329 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -# This file was generated on 2021-07-15T10:45:52+01:00 from the rspec-dev repo. +# This file was generated on 2022-01-10T22:24:10+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. name: RSpec CI @@ -16,12 +16,27 @@ env: # This tells rspec-rails what branch to run in ci RSPEC_VERSION: '= 3.11.0.pre' jobs: + rubocop: + name: Rubocop + runs-on: 'ubuntu-20.04' + steps: + - uses: actions/checkout@v2 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.0' + - run: script/update_rubygems_and_install_bundler + - run: script/clone_all_rspec_repos + - run: bundle install --standalone + - run: bundle binstubs --all + - run: script/run_rubocop + test: name: Ruby ${{ matrix.ruby }} ${{ matrix.name_extra || '' }} runs-on: ${{ matrix.os || 'ubuntu-20.04' }} strategy: matrix: ruby: + - '3.1' - '3.0' - 2.7 - 2.6 diff --git a/.rubocop_rspec_base.yml b/.rubocop_rspec_base.yml index 0adf2f7ca7..19ae673ce2 100644 --- a/.rubocop_rspec_base.yml +++ b/.rubocop_rspec_base.yml @@ -1,4 +1,4 @@ -# This file was generated on 2021-07-15T10:45:52+01:00 from the rspec-dev repo. +# This file was generated on 2022-01-10T22:24:10+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. # This file contains defaults for RSpec projects. Individual projects diff --git a/script/ci_functions.sh b/script/ci_functions.sh index 44f68ac596..28d41f4a06 100644 --- a/script/ci_functions.sh +++ b/script/ci_functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2021-07-15T10:45:52+01:00 from the rspec-dev repo. +# This file was generated on 2022-01-10T22:24:10+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. # Taken from: diff --git a/script/clone_all_rspec_repos b/script/clone_all_rspec_repos index cebc3f7a80..dc9822ae74 100755 --- a/script/clone_all_rspec_repos +++ b/script/clone_all_rspec_repos @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2021-07-15T10:45:52+01:00 from the rspec-dev repo. +# This file was generated on 2022-01-10T22:24:10+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e diff --git a/script/cucumber.sh b/script/cucumber.sh index 6982d35774..51ce7911e6 100755 --- a/script/cucumber.sh +++ b/script/cucumber.sh @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2021-07-15T10:45:52+01:00 from the rspec-dev repo. +# This file was generated on 2022-01-10T22:24:10+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e diff --git a/script/functions.sh b/script/functions.sh index 72b4296e04..b42caa3828 100644 --- a/script/functions.sh +++ b/script/functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2021-07-15T10:45:52+01:00 from the rspec-dev repo. +# This file was generated on 2022-01-10T22:24:10+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" diff --git a/script/legacy_setup.sh b/script/legacy_setup.sh index 9e72d4f5d8..9334052169 100755 --- a/script/legacy_setup.sh +++ b/script/legacy_setup.sh @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2021-07-15T10:45:52+01:00 from the rspec-dev repo. +# This file was generated on 2022-01-10T22:24:10+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e diff --git a/script/predicate_functions.sh b/script/predicate_functions.sh index 415d189127..d6f21a7b57 100644 --- a/script/predicate_functions.sh +++ b/script/predicate_functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2021-07-15T10:45:52+01:00 from the rspec-dev repo. +# This file was generated on 2022-01-10T22:24:10+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. function is_mri { @@ -95,9 +95,22 @@ function is_ruby_25_plus { fi } +function is_ruby_31_plus { + if ruby -e "exit(RUBY_VERSION.to_f >= 3.1)"; then + return 0 + else + return 1 + fi +} + function rspec_rails_compatible { if is_ruby_25_plus; then - return 0 + # TODO remove when RSpec-Rails build is 3.1 safe by default + if is_ruby_31_plus; then + return 1 + else + return 0 + fi else return 1 fi diff --git a/script/run_build b/script/run_build index 794e12ca26..46c230ca70 100755 --- a/script/run_build +++ b/script/run_build @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2021-07-15T10:45:52+01:00 from the rspec-dev repo. +# This file was generated on 2022-01-10T22:24:10+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e @@ -24,10 +24,6 @@ if documentation_enforced; then fold "doc check" check_documentation_coverage fi -if style_and_lint_enforced; then - fold "rubocop" check_style_and_lint -fi - if supports_cross_build_checks; then fold "one-by-one specs" run_specs_one_by_one export NO_COVERAGE=true diff --git a/script/run_rubocop b/script/run_rubocop new file mode 100755 index 0000000000..c2d94dcca3 --- /dev/null +++ b/script/run_rubocop @@ -0,0 +1,14 @@ +#!/bin/bash +# This file was generated on 2022-01-10T22:24:10+00:00 from the rspec-dev repo. +# DO NOT modify it by hand as your changes will get lost the next time it is generated. + +set -e +source script/functions.sh + +# Allow repos to override the default functions and add their own +if [ -f script/custom_build_functions.sh ]; then + source script/custom_build_functions.sh +fi + + +fold "rubocop" check_style_and_lint diff --git a/script/update_rubygems_and_install_bundler b/script/update_rubygems_and_install_bundler index 26523a607b..2facf79a66 100755 --- a/script/update_rubygems_and_install_bundler +++ b/script/update_rubygems_and_install_bundler @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2021-07-15T10:45:52+01:00 from the rspec-dev repo. +# This file was generated on 2022-01-10T22:24:10+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e From 6e8db57b098f4184f3f9c1319a113b6f37ac2c34 Mon Sep 17 00:00:00 2001 From: Jared Beck Date: Sun, 2 Jan 2022 23:09:34 -0500 Subject: [PATCH 095/104] Warn about exit in helper >> Yes using `exit` or `abort` will cause RSpec to quit .. I am wondering if we should print a warning about that happening... > > Yes, please! Such a warning will be very helpful, as in https://github.com/rspec/rspec-rails/issues/2441#issuecomment-1003212668 The current output "No examples found" is misleading. > > https://github.com/rspec/rspec-core/issues/2508#issuecomment-1003461353 --- lib/rspec/core/configuration.rb | 5 +++++ lib/rspec/core/world.rb | 18 ++++++++++++++---- .../integration/spec_file_load_errors_spec.rb | 19 +++++++++++++++++++ 3 files changed, 38 insertions(+), 4 deletions(-) diff --git a/lib/rspec/core/configuration.rb b/lib/rspec/core/configuration.rb index 399ae15d6c..ccc49590d6 100644 --- a/lib/rspec/core/configuration.rb +++ b/lib/rspec/core/configuration.rb @@ -2122,6 +2122,11 @@ def load_file_handling_errors(method, file) relative_file = Metadata.relative_path(file) reporter.notify_non_example_exception(ex, "An error occurred while loading #{relative_file}.") RSpec.world.wants_to_quit = true + rescue SystemExit => ex + relative_file = Metadata.relative_path(file) + reporter.notify_non_example_exception(ex, "While loading #{relative_file} an `exit` / `raise SystemExit` occurred, RSpec will now quit.") + RSpec.world.rspec_is_quitting = true + raise ex end def handle_suite_hook(scope, meta) diff --git a/lib/rspec/core/world.rb b/lib/rspec/core/world.rb index 12909cab01..6fb439659b 100644 --- a/lib/rspec/core/world.rb +++ b/lib/rspec/core/world.rb @@ -10,6 +10,13 @@ class World # Used internally to determine what to do when a SIGINT is received. attr_accessor :wants_to_quit + # Used internally to signify that a SystemExit occurred in + # `Configuration#load_file_handling_errors`, and thus examples cannot + # be counted accurately. Specifically, we cannot accurately report + # "No examples found". + # @private + attr_accessor :rspec_is_quitting + # Used internally to signal that a failure outside of an example # has occurred, and that therefore the exit status should indicate # the run failed. @@ -18,6 +25,7 @@ class World def initialize(configuration=RSpec.configuration) @wants_to_quit = false + @rspec_is_quitting = false @configuration = configuration configuration.world = self @example_groups = [] @@ -184,10 +192,12 @@ def announce_filters return unless example_count.zero? example_groups.clear - if filter_manager.empty? - report_filter_message("No examples found.") - elsif exclusion_filter.empty? || inclusion_filter.empty? - report_filter_message(everything_filtered_message) + unless rspec_is_quitting + if filter_manager.empty? + report_filter_message("No examples found.") + elsif exclusion_filter.empty? || inclusion_filter.empty? + report_filter_message(everything_filtered_message) + end end end diff --git a/spec/integration/spec_file_load_errors_spec.rb b/spec/integration/spec_file_load_errors_spec.rb index 7289ba1014..75e4fe93eb 100644 --- a/spec/integration/spec_file_load_errors_spec.rb +++ b/spec/integration/spec_file_load_errors_spec.rb @@ -82,6 +82,25 @@ EOS end + it 'prints a warning when a helper file exits early' do + write_file_formatted "helper_with_exit.rb", "exit 999" + + expect { + run_command "--require ./helper_with_exit.rb" + }.to raise_error(SystemExit) + output = normalize_durations(last_cmd_stdout) + expect(output).to eq unindent(<<-EOS) + + While loading ./helper_with_exit.rb an `exit` / `raise SystemExit` occurred, RSpec will now quit. + Failure/Error: exit 999 + + SystemExit: + exit + # ./helper_with_exit.rb:1:in `exit' + # ./helper_with_exit.rb:1#{spec_line_suffix} + EOS + end + it 'nicely handles load-time errors in user spec files' do write_file_formatted "1_spec.rb", " boom From dd0b8dd772a43c18a0c9b5c50eaf53c254a640a4 Mon Sep 17 00:00:00 2001 From: Jared Beck Date: Thu, 13 Jan 2022 11:28:45 -0500 Subject: [PATCH 096/104] rubocop --- lib/rspec/core/configuration.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/rspec/core/configuration.rb b/lib/rspec/core/configuration.rb index ccc49590d6..4bf80f01f4 100644 --- a/lib/rspec/core/configuration.rb +++ b/lib/rspec/core/configuration.rb @@ -2124,7 +2124,10 @@ def load_file_handling_errors(method, file) RSpec.world.wants_to_quit = true rescue SystemExit => ex relative_file = Metadata.relative_path(file) - reporter.notify_non_example_exception(ex, "While loading #{relative_file} an `exit` / `raise SystemExit` occurred, RSpec will now quit.") + reporter.notify_non_example_exception( + ex, + "While loading #{relative_file} an `exit` / `raise SystemExit` occurred, RSpec will now quit." + ) RSpec.world.rspec_is_quitting = true raise ex end From 210ac5725344ca23f867e0c9744ee51be7aa323d Mon Sep 17 00:00:00 2001 From: Jared Beck Date: Wed, 19 Jan 2022 19:28:43 -0500 Subject: [PATCH 097/104] Update test for JRuby --- spec/integration/spec_file_load_errors_spec.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/spec/integration/spec_file_load_errors_spec.rb b/spec/integration/spec_file_load_errors_spec.rb index 75e4fe93eb..cd5c358242 100644 --- a/spec/integration/spec_file_load_errors_spec.rb +++ b/spec/integration/spec_file_load_errors_spec.rb @@ -89,10 +89,17 @@ run_command "--require ./helper_with_exit.rb" }.to raise_error(SystemExit) output = normalize_durations(last_cmd_stdout) + expected_error_line = ->() { + if defined?(JRUBY_VERSION) && !JRUBY_VERSION.empty? + "Unable to find org/jruby/RubyKernel.java to read failed line" + else + "exit 999" + end + } expect(output).to eq unindent(<<-EOS) While loading ./helper_with_exit.rb an `exit` / `raise SystemExit` occurred, RSpec will now quit. - Failure/Error: exit 999 + Failure/Error: #{expected_error_line.call} SystemExit: exit From c85bacc79943812470061f964e7b5c721ce0322d Mon Sep 17 00:00:00 2001 From: Jared Beck Date: Mon, 24 Jan 2022 12:04:23 -0500 Subject: [PATCH 098/104] jruby --- .../integration/spec_file_load_errors_spec.rb | 39 +++++++++++-------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/spec/integration/spec_file_load_errors_spec.rb b/spec/integration/spec_file_load_errors_spec.rb index cd5c358242..118c1103ea 100644 --- a/spec/integration/spec_file_load_errors_spec.rb +++ b/spec/integration/spec_file_load_errors_spec.rb @@ -89,23 +89,28 @@ run_command "--require ./helper_with_exit.rb" }.to raise_error(SystemExit) output = normalize_durations(last_cmd_stdout) - expected_error_line = ->() { - if defined?(JRUBY_VERSION) && !JRUBY_VERSION.empty? - "Unable to find org/jruby/RubyKernel.java to read failed line" - else - "exit 999" - end - } - expect(output).to eq unindent(<<-EOS) - - While loading ./helper_with_exit.rb an `exit` / `raise SystemExit` occurred, RSpec will now quit. - Failure/Error: #{expected_error_line.call} - - SystemExit: - exit - # ./helper_with_exit.rb:1:in `exit' - # ./helper_with_exit.rb:1#{spec_line_suffix} - EOS + if defined?(JRUBY_VERSION) && !JRUBY_VERSION.empty? + expect(output).to eq unindent(<<-EOS) + + While loading ./helper_with_exit.rb an `exit` / `raise SystemExit` occurred, RSpec will now quit. + Failure/Error: Unable to find org/jruby/RubyKernel.java to read failed line + + SystemExit: + exit + # ./helper_with_exit.rb:1#{spec_line_suffix} + EOS + else + expect(output).to eq unindent(<<-EOS) + + While loading ./helper_with_exit.rb an `exit` / `raise SystemExit` occurred, RSpec will now quit. + Failure/Error: exit 999 + + SystemExit: + exit + # ./helper_with_exit.rb:1:in `exit' + # ./helper_with_exit.rb:1#{spec_line_suffix} + EOS + end end it 'nicely handles load-time errors in user spec files' do From bac063fb359a9ac070d56f9ab4c81c615e737094 Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Tue, 25 Jan 2022 08:20:51 +0000 Subject: [PATCH 099/104] Update changelog.md for #2926 --- Changelog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Changelog.md b/Changelog.md index 2b08c7cd1c..50217bfcc0 100644 --- a/Changelog.md +++ b/Changelog.md @@ -9,6 +9,7 @@ Enhancements: * Introduce `RSpec.current_scope` to expose the current scope in which RSpec is executing. e.g. `:before_example_hook`, `:example` etc. (@odinhb, #2895) * Add named bold colours as options for custom colours. (#2913, #2914) +* Warn when (but not prevent) a `SystemExit` occurs. (Jared Beck, #2926) Bug fixes: From 20fd9f9f0f246334eed5428ca1e8d44ac91f868b Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Wed, 26 Jan 2022 13:58:53 +0000 Subject: [PATCH 100/104] Updated ci build scripts (from rspec-dev)main --- .github/workflows/ci.yml | 2 +- .rubocop_rspec_base.yml | 2 +- script/ci_functions.sh | 2 +- script/clone_all_rspec_repos | 2 +- script/cucumber.sh | 2 +- script/functions.sh | 2 +- script/legacy_setup.sh | 2 +- script/predicate_functions.sh | 2 +- script/run_build | 2 +- script/run_rubocop | 2 +- script/update_rubygems_and_install_bundler | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1d5de7f329..daf8df1e8b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -# This file was generated on 2022-01-10T22:24:10+00:00 from the rspec-dev repo. +# This file was generated on 2022-01-26T13:58:53+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. name: RSpec CI diff --git a/.rubocop_rspec_base.yml b/.rubocop_rspec_base.yml index 19ae673ce2..13974fe8d0 100644 --- a/.rubocop_rspec_base.yml +++ b/.rubocop_rspec_base.yml @@ -1,4 +1,4 @@ -# This file was generated on 2022-01-10T22:24:10+00:00 from the rspec-dev repo. +# This file was generated on 2022-01-26T13:58:53+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. # This file contains defaults for RSpec projects. Individual projects diff --git a/script/ci_functions.sh b/script/ci_functions.sh index 28d41f4a06..add930da19 100644 --- a/script/ci_functions.sh +++ b/script/ci_functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2022-01-10T22:24:10+00:00 from the rspec-dev repo. +# This file was generated on 2022-01-26T13:58:53+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. # Taken from: diff --git a/script/clone_all_rspec_repos b/script/clone_all_rspec_repos index dc9822ae74..e786c16deb 100755 --- a/script/clone_all_rspec_repos +++ b/script/clone_all_rspec_repos @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2022-01-10T22:24:10+00:00 from the rspec-dev repo. +# This file was generated on 2022-01-26T13:58:53+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e diff --git a/script/cucumber.sh b/script/cucumber.sh index 51ce7911e6..1710fe80e2 100755 --- a/script/cucumber.sh +++ b/script/cucumber.sh @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2022-01-10T22:24:10+00:00 from the rspec-dev repo. +# This file was generated on 2022-01-26T13:58:53+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e diff --git a/script/functions.sh b/script/functions.sh index b42caa3828..f15e4b20ad 100644 --- a/script/functions.sh +++ b/script/functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2022-01-10T22:24:10+00:00 from the rspec-dev repo. +# This file was generated on 2022-01-26T13:58:53+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" diff --git a/script/legacy_setup.sh b/script/legacy_setup.sh index 9334052169..0f4430afba 100755 --- a/script/legacy_setup.sh +++ b/script/legacy_setup.sh @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2022-01-10T22:24:10+00:00 from the rspec-dev repo. +# This file was generated on 2022-01-26T13:58:53+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e diff --git a/script/predicate_functions.sh b/script/predicate_functions.sh index d6f21a7b57..18bf619897 100644 --- a/script/predicate_functions.sh +++ b/script/predicate_functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2022-01-10T22:24:10+00:00 from the rspec-dev repo. +# This file was generated on 2022-01-26T13:58:53+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. function is_mri { diff --git a/script/run_build b/script/run_build index 46c230ca70..2fc3375398 100755 --- a/script/run_build +++ b/script/run_build @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2022-01-10T22:24:10+00:00 from the rspec-dev repo. +# This file was generated on 2022-01-26T13:58:53+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e diff --git a/script/run_rubocop b/script/run_rubocop index c2d94dcca3..d8caff16f4 100755 --- a/script/run_rubocop +++ b/script/run_rubocop @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2022-01-10T22:24:10+00:00 from the rspec-dev repo. +# This file was generated on 2022-01-26T13:58:53+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e diff --git a/script/update_rubygems_and_install_bundler b/script/update_rubygems_and_install_bundler index 2facf79a66..42194ea153 100755 --- a/script/update_rubygems_and_install_bundler +++ b/script/update_rubygems_and_install_bundler @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2022-01-10T22:24:10+00:00 from the rspec-dev repo. +# This file was generated on 2022-01-26T13:58:53+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e From 28d22249a1ddbb328c02628e08e39a0f3b885964 Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Sun, 30 Jan 2022 10:38:31 +0000 Subject: [PATCH 101/104] Updated ci build scripts (from rspec-dev)main --- .github/workflows/ci.yml | 2 +- .rubocop_rspec_base.yml | 2 +- script/ci_functions.sh | 2 +- script/clone_all_rspec_repos | 2 +- script/cucumber.sh | 2 +- script/functions.sh | 2 +- script/legacy_setup.sh | 2 +- script/predicate_functions.sh | 2 +- script/run_build | 2 +- script/run_rubocop | 2 +- script/update_rubygems_and_install_bundler | 9 +++++++-- 11 files changed, 17 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index daf8df1e8b..6a678a1598 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -# This file was generated on 2022-01-26T13:58:53+00:00 from the rspec-dev repo. +# This file was generated on 2022-01-30T10:38:31+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. name: RSpec CI diff --git a/.rubocop_rspec_base.yml b/.rubocop_rspec_base.yml index 13974fe8d0..1a19dfbff1 100644 --- a/.rubocop_rspec_base.yml +++ b/.rubocop_rspec_base.yml @@ -1,4 +1,4 @@ -# This file was generated on 2022-01-26T13:58:53+00:00 from the rspec-dev repo. +# This file was generated on 2022-01-30T10:38:31+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. # This file contains defaults for RSpec projects. Individual projects diff --git a/script/ci_functions.sh b/script/ci_functions.sh index add930da19..5c62a54c0a 100644 --- a/script/ci_functions.sh +++ b/script/ci_functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2022-01-26T13:58:53+00:00 from the rspec-dev repo. +# This file was generated on 2022-01-30T10:38:31+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. # Taken from: diff --git a/script/clone_all_rspec_repos b/script/clone_all_rspec_repos index e786c16deb..cc09066afb 100755 --- a/script/clone_all_rspec_repos +++ b/script/clone_all_rspec_repos @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2022-01-26T13:58:53+00:00 from the rspec-dev repo. +# This file was generated on 2022-01-30T10:38:31+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e diff --git a/script/cucumber.sh b/script/cucumber.sh index 1710fe80e2..d1a15e9c49 100755 --- a/script/cucumber.sh +++ b/script/cucumber.sh @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2022-01-26T13:58:53+00:00 from the rspec-dev repo. +# This file was generated on 2022-01-30T10:38:31+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e diff --git a/script/functions.sh b/script/functions.sh index f15e4b20ad..be534f2e2e 100644 --- a/script/functions.sh +++ b/script/functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2022-01-26T13:58:53+00:00 from the rspec-dev repo. +# This file was generated on 2022-01-30T10:38:31+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" diff --git a/script/legacy_setup.sh b/script/legacy_setup.sh index 0f4430afba..5b6d0eaa88 100755 --- a/script/legacy_setup.sh +++ b/script/legacy_setup.sh @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2022-01-26T13:58:53+00:00 from the rspec-dev repo. +# This file was generated on 2022-01-30T10:38:31+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e diff --git a/script/predicate_functions.sh b/script/predicate_functions.sh index 18bf619897..b0bc8387e5 100644 --- a/script/predicate_functions.sh +++ b/script/predicate_functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2022-01-26T13:58:53+00:00 from the rspec-dev repo. +# This file was generated on 2022-01-30T10:38:31+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. function is_mri { diff --git a/script/run_build b/script/run_build index 2fc3375398..b34864446f 100755 --- a/script/run_build +++ b/script/run_build @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2022-01-26T13:58:53+00:00 from the rspec-dev repo. +# This file was generated on 2022-01-30T10:38:31+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e diff --git a/script/run_rubocop b/script/run_rubocop index d8caff16f4..ec26db85ba 100755 --- a/script/run_rubocop +++ b/script/run_rubocop @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2022-01-26T13:58:53+00:00 from the rspec-dev repo. +# This file was generated on 2022-01-30T10:38:31+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e diff --git a/script/update_rubygems_and_install_bundler b/script/update_rubygems_and_install_bundler index 42194ea153..00cc7d4e89 100755 --- a/script/update_rubygems_and_install_bundler +++ b/script/update_rubygems_and_install_bundler @@ -1,11 +1,16 @@ #!/bin/bash -# This file was generated on 2022-01-26T13:58:53+00:00 from the rspec-dev repo. +# This file was generated on 2022-01-30T10:38:31+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e source script/functions.sh -if is_ruby_23_plus; then +if is_ruby_31_plus; then + echo "Installing rubygems 3.3.6 / bundler 2.3.6" + yes | gem update --system '3.3.6' + yes | gem install bundler -v '2.3.6' +elif is_ruby_23_plus; then + echo "Installing rubygems 3.2.22 / bundler 2.2.22" yes | gem update --system '3.2.22' yes | gem install bundler -v '2.2.22' else From 1abe150a8f2c0014fe0ed06317a36b39a009ae48 Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Thu, 27 Jan 2022 22:22:32 +0000 Subject: [PATCH 102/104] Version 3.10.2 --- Changelog.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Changelog.md b/Changelog.md index 50217bfcc0..343b14f906 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,5 +1,5 @@ ### Development -[Full Changelog](http://github.com/rspec/rspec-core/compare/v3.10.1...main) +[Full Changelog](http://github.com/rspec/rspec-core/compare/v3.10.2...main) Enhancements: @@ -11,6 +11,9 @@ Enhancements: * Add named bold colours as options for custom colours. (#2913, #2914) * Warn when (but not prevent) a `SystemExit` occurs. (Jared Beck, #2926) +### 3.10.2 / 2022-01-27 +[Full Changelog](http://github.com/rspec/rspec-core/compare/v3.10.1...v3.10.2) + Bug fixes: * Ensure bisect communication uses consistent encoding. (Mike Jarema, #2852) From e6d5718f9f3e189bd428ba50298abc456deecd8f Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Wed, 9 Feb 2022 09:59:26 +0000 Subject: [PATCH 103/104] Version 3.11.0 --- Changelog.md | 5 ++++- lib/rspec/core/version.rb | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Changelog.md b/Changelog.md index 343b14f906..69c725a3f2 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,5 +1,8 @@ ### Development -[Full Changelog](http://github.com/rspec/rspec-core/compare/v3.10.2...main) +[Full Changelog](http://github.com/rspec/rspec-core/compare/v3.11.0...main) + +### 3.11.0 / 2022-02-09 +[Full Changelog](http://github.com/rspec/rspec-core/compare/v3.10.2...v3.11.0) Enhancements: diff --git a/lib/rspec/core/version.rb b/lib/rspec/core/version.rb index 97a58aefe8..a4620887b3 100644 --- a/lib/rspec/core/version.rb +++ b/lib/rspec/core/version.rb @@ -3,7 +3,7 @@ module Core # Version information for RSpec Core. module Version # Current version of RSpec Core, in semantic versioning format. - STRING = '3.11.0.pre' + STRING = '3.12.0.pre' end end end From 7a38c055f2259602d42fa4bfd73f57bad4e4eff3 Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Wed, 9 Feb 2022 09:59:26 +0000 Subject: [PATCH 104/104] Version 3.11.0 --- .github/workflows/ci.yml | 2 +- Changelog.md | 2 +- lib/rspec/core/version.rb | 2 +- maintenance-branch | 2 +- script/clone_all_rspec_repos | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6a678a1598..05c0e6fc40 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ on: env: RSPEC_CI: true # This tells rspec-rails what branch to run in ci - RSPEC_VERSION: '= 3.11.0.pre' + RSPEC_VERSION: '~> 3.11.0' jobs: rubocop: name: Rubocop diff --git a/Changelog.md b/Changelog.md index 69c725a3f2..1e81b34002 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,5 +1,5 @@ ### Development -[Full Changelog](http://github.com/rspec/rspec-core/compare/v3.11.0...main) +[Full Changelog](http://github.com/rspec/rspec-core/compare/v3.11.0...3-11-maintenance) ### 3.11.0 / 2022-02-09 [Full Changelog](http://github.com/rspec/rspec-core/compare/v3.10.2...v3.11.0) diff --git a/lib/rspec/core/version.rb b/lib/rspec/core/version.rb index a4620887b3..ef92e9cb05 100644 --- a/lib/rspec/core/version.rb +++ b/lib/rspec/core/version.rb @@ -3,7 +3,7 @@ module Core # Version information for RSpec Core. module Version # Current version of RSpec Core, in semantic versioning format. - STRING = '3.12.0.pre' + STRING = '3.11.0' end end end diff --git a/maintenance-branch b/maintenance-branch index ba2906d066..f3626d98db 100644 --- a/maintenance-branch +++ b/maintenance-branch @@ -1 +1 @@ -main +3-11-maintenance diff --git a/script/clone_all_rspec_repos b/script/clone_all_rspec_repos index cc09066afb..58c1c3307d 100755 --- a/script/clone_all_rspec_repos +++ b/script/clone_all_rspec_repos @@ -12,7 +12,7 @@ if is_mri; then clone_repo "rspec-core" clone_repo "rspec-expectations" clone_repo "rspec-mocks" - clone_repo "rspec-rails" + clone_repo "rspec-rails" "5-1-maintenance" if rspec_support_compatible; then clone_repo "rspec-support"