diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8f8bb74aca..c0bb76e3c4 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-29T14:01:14+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 @@ -11,6 +11,8 @@ on: pull_request: branches: - '*' +env: + RSPEC_CI: true jobs: test: name: Ruby ${{ matrix.ruby }} @@ -24,8 +26,6 @@ jobs: - 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') }} @@ -40,3 +40,25 @@ 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 + 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..3844aa0811 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-29T14:01:14+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 953515fb02..40e9215175 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,3 @@ -# 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. dist: trusty language: ruby @@ -15,29 +12,14 @@ before_install: bundler_args: "--binstubs --standalone --without documentation --path ../bundle" script: "script/run_build" rvm: - - 1.8.7 - - 1.9.2 - - 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' + - RSPEC_CI='true' 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/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/lib/rspec/core/version.rb b/lib/rspec/core/version.rb index 97a58aefe8..538ab02627 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 = '4.0.0.pre' end end end diff --git a/maintenance-branch b/maintenance-branch index ba2906d066..e6fbea6d90 100644 --- a/maintenance-branch +++ b/maintenance-branch @@ -1 +1 @@ -main +4-0-dev \ No newline at end of file diff --git a/script/ci_functions.sh b/script/ci_functions.sh index 38f4064ae3..8048ff472f 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-29T14:01:14+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 9ba9631cd0..654b3ed060 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-29T14:01:14+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 @@ -12,11 +12,8 @@ if is_mri; then clone_repo "rspec-core" clone_repo "rspec-expectations" clone_repo "rspec-mocks" - clone_repo "rspec-rails" - - if rspec_support_compatible; then - clone_repo "rspec-support" - fi + clone_repo "rspec-rails" "main" + clone_repo "rspec-support" popd else diff --git a/script/functions.sh b/script/functions.sh index 0716529f39..29fe17ab10 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-29T14:01:14+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 )" @@ -12,14 +12,20 @@ SPECS_HAVE_RUN_FILE=specs.out MAINTENANCE_BRANCH=`cat maintenance-branch` # Don't allow rubygems to pollute what's loaded. Also, things boot faster -# without the extra load time of rubygems. Only works on MRI Ruby 1.9+ -if is_mri_192_plus; then +# without the extra load time of rubygems. Only works on MRI. +if is_mri; then export RUBYOPT="--disable=gem" 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; } @@ -47,12 +53,7 @@ function run_cukes { echo "${PWD}/bin/cucumber" - if is_mri_192; then - # For some reason we get SystemStackError on 1.9.2 when using - # the bin/cucumber approach below. That approach is faster - # (as it avoids the bundler tax), so we use it on rubies where we can. - bundle exec cucumber --strict - elif is_jruby; then + if is_jruby; then # For some reason JRuby doesn't like our improved bundler setup RUBYOPT="-I${PWD}/../bundle -rbundler/setup" \ PATH="${PWD}/bin:$PATH" \ @@ -187,11 +188,8 @@ function run_all_spec_suites { fold "rspec-core specs" run_spec_suite_for "rspec-core" fold "rspec-expectations specs" run_spec_suite_for "rspec-expectations" fold "rspec-mocks specs" run_spec_suite_for "rspec-mocks" + fold "rspec-support specs" run_spec_suite_for "rspec-support" if rspec_rails_compatible; then fold "rspec-rails specs" run_spec_suite_for "rspec-rails" fi - - if rspec_support_compatible; then - fold "rspec-support specs" run_spec_suite_for "rspec-support" - fi } diff --git a/script/predicate_functions.sh b/script/predicate_functions.sh index ca2ca30018..eafb8a5d3f 100644 --- a/script/predicate_functions.sh +++ b/script/predicate_functions.sh @@ -1,10 +1,9 @@ -# This file was generated on 2020-11-16T22:10:29+00:00 from the rspec-dev repo. +# This file was generated on 2020-11-29T14:01:14+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 { - if ruby -e "exit(!defined?(RUBY_ENGINE) || RUBY_ENGINE == 'ruby')"; then - # RUBY_ENGINE only returns 'ruby' on MRI. - # MRI 1.8.7 lacks the constant but all other rubies have it (including JRuby in 1.8 mode) + # RUBY_ENGINE only returns 'ruby' on MRI. + if ruby -e "exit(RUBY_ENGINE == 'ruby')"; then return 0 else return 1 @@ -12,59 +11,14 @@ function is_mri { } function is_jruby { - if ruby -e "exit(defined?(RUBY_PLATFORM) && RUBY_PLATFORM == 'java')"; then - # RUBY_ENGINE only returns 'ruby' on MRI. - # MRI 1.8.7 lacks the constant but all other rubies have it (including JRuby in 1.8 mode) + # RUBY_PLATFORM only returns 'java' on JRuby. + if ruby -e "exit(RUBY_PLATFORM == 'java')"; then return 0 else return 1 fi; } -function is_mri_192 { - if is_mri; then - if ruby -e "exit(RUBY_VERSION == '1.9.2')"; then - return 0 - else - return 1 - fi - else - return 1 - fi -} - -function is_mri_192_plus { - if is_mri; then - if ruby -e "exit(RUBY_VERSION.to_f > 1.8)"; then - return 0 - else - return 1 - fi - else - return 1 - fi -} - -function is_mri_2plus { - if is_mri; then - if ruby -e "exit(RUBY_VERSION.to_f > 2.0)"; then - return 0 - else - return 1 - fi - else - return 1 - fi -} - -function is_ruby_23_plus { - if ruby -e "exit(RUBY_VERSION.to_f >= 2.3)"; then - return 0 - else - return 1 - fi -} - function is_ruby_25_plus { if ruby -e "exit(RUBY_VERSION.to_f >= 2.5)"; then return 0 @@ -81,14 +35,6 @@ function rspec_rails_compatible { fi } -function rspec_support_compatible { - if [ "$MAINTENANCE_BRANCH" != "2-99-maintenance" ] && [ "$MAINTENANCE_BRANCH" != "2-14-maintenance" ]; then - return 0 - else - return 1 - fi -} - function additional_specs_available { type run_additional_specs > /dev/null 2>&1 return $? @@ -96,7 +42,7 @@ function additional_specs_available { function documentation_enforced { if [ -x ./bin/yard ]; then - if is_mri_2plus; then + if is_mri; then return 0 else return 1 diff --git a/script/run_build b/script/run_build index a6aebb2bc1..4b1f8ef0e1 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-29T14:01:14+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/update_rubygems_and_install_bundler b/script/update_rubygems_and_install_bundler index f244a3f155..6ea8b36719 100755 --- a/script/update_rubygems_and_install_bundler +++ b/script/update_rubygems_and_install_bundler @@ -1,15 +1,9 @@ #!/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-29T14:01:14+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 source script/functions.sh -if is_ruby_23_plus; then - yes | gem update --system - yes | gem install bundler -else - echo "Warning installing older versions of Rubygems / Bundler" - gem update --system '2.7.8' - gem install bundler -v '1.17.3' -fi +yes | gem update --system +yes | gem install bundler 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..f007fd3328 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,8 @@ 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", :if => RSpec::Support::OS.windows? do + pending "Fails for some reason yet to be discovered" 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..58fa66432e 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,8 @@ 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" do + pending "Fails on Windows for some reason yet to be discovered" if RSpec::Support::OS.windows? spec_dir = File.join(Dir.getwd, "spec") task.pattern = "spec/*spec.rb" FileUtils.mkdir_p(spec_dir)