Skip to content

Commit

Permalink
Restore parity with rspec-dev #3098
Browse files Browse the repository at this point in the history
  • Loading branch information
JonRowe committed Sep 5, 2024
1 parent 19df539 commit 203fe0a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ env:
RSPEC_CI: true
# This tells rspec-rails what branch to run in ci
RSPEC_VERSION: '~> 3.13.0'
ENFORCE_COVERAGE_AFTER: "3.2"
jobs:
rubocop:
name: Rubocop
Expand Down Expand Up @@ -131,7 +130,6 @@ jobs:
env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
LEGACY_CI: true
NO_COVERAGE: true
JRUBY_OPTS: ${{ matrix.container.jruby_opts || '--dev' }}
NO_COVERAGE: true
steps:
Expand Down
4 changes: 2 additions & 2 deletions lib/rspec/core/configuration_options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -177,15 +177,15 @@ def args_from_options_file(path)
FlatMap.flat_map(config_lines, &:shellsplit)
end

# :nocov:
def options_file_as_erb_string(path)
if RUBY_VERSION >= '2.6'
ERB.new(File.read(path), :trim_mode => '-').result(binding)
else
# :nocov:
ERB.new(File.read(path), nil, '-').result(binding)
# :nocov:
end
end
# :nocov:

def custom_options_file
command_line_options[:custom_options_file]
Expand Down
4 changes: 2 additions & 2 deletions lib/rspec/core/formatters/exception_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ def failure_slash_error_lines
end

# rubocop:disable Lint/RescueException
# :nocov:
if SyntaxError.instance_methods.include?(:detailed_message)
def exception_message_string(exception)
case exception
Expand All @@ -191,14 +192,13 @@ def exception_message_string(exception)
"A #{exception.class} for which `exception.message.to_s` raises #{other.class}."
end
else
# :nocov:
def exception_message_string(exception)
exception.message.to_s
rescue Exception => other
"A #{exception.class} for which `exception.message.to_s` raises #{other.class}."
end
# :nocov:
end
# :nocov:
# rubocop:enable Lint/RescueException

def exception_lines
Expand Down
2 changes: 2 additions & 0 deletions lib/rspec/core/option_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,9 @@ def parser(options)

parser.on('-w', '--warnings', 'Enable ruby warnings') do
if Object.const_defined?(:Warning) && Warning.respond_to?(:[]=)
# :nocov: on older Ruby without Warning
Warning[:deprecated] = true
# :nocov:
end
$VERBOSE = true
end
Expand Down

0 comments on commit 203fe0a

Please sign in to comment.