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

Updates from rspec-dev (2020-11-22) #2785

Merged
merged 4 commits into from
Dec 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 26 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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:
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .rubocop_rspec_base.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
13 changes: 1 addition & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -20,24 +20,13 @@ 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'
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:
Expand Down
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion script/ci_functions.sh
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
2 changes: 1 addition & 1 deletion script/clone_all_rspec_repos
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion script/functions.sh
Original file line number Diff line number Diff line change
@@ -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 )"
Expand Down
2 changes: 1 addition & 1 deletion script/predicate_functions.sh
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion script/run_build
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion script/update_rubygems_and_install_bundler
Original file line number Diff line number Diff line change
@@ -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
Expand Down
21 changes: 18 additions & 3 deletions spec/integration/suite_hooks_errors_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 <main>'" }
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)'" }
Expand Down Expand Up @@ -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 <main>'
EOS
else
""
end

run_command "the_spec.rb"
expect(last_cmd_exit_status).to eq(error_exit_code)
output = normalize_durations(last_cmd_stdout)
Expand All @@ -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
Expand Down
8 changes: 6 additions & 2 deletions spec/rspec/core/formatters/exception_presenter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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').",
Expand All @@ -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')."
Expand Down