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

Description
Subject of the issue
Ruby 3's end-less methods seem to make Rspec hang when a method raises an error.
Your environment
- Ruby version: 3.0.1
- rspec-core version: 3.10.1
Steps to reproduce
require 'rspec/autorun'
class Test
def foo = (raise 'error')
def bar = 123
end
RSpec.describe Test do
describe '#foo' do
it 'returns' do
expect(Test.new.foo).to eq true
end
end
end
bundle exec ruby test.rb
Test
#foo
returns (FAILED - 1)
[hangs]
Expected behavior
This test run should produce a failure with stacktrace and error details as the example doesn't expect the error.
Actual behavior
RSpec hangs indefinitely.
Commenting out the bar method, moving it above foo or turning it into a method with the classic syntax sorts the problem.