Running the following spec with rspec --order defined causes a RuntimeError:
`sig` not present for method `bar` but you're trying to run it anyways. This should only be executed if you used `alias_method` to grab a handle to a method after `sig`ing it, but that clearly isn't what you are doing. Maybe look to see if an exception was thrown in your `sig` lambda or somehow else your `sig` wasn't actually applied to the method. Contact #dev-productivity if you're really stuck.
describe 'sig consistency error' do
class Foo
sig { returns(String) }
def bar
'hello'
end
end
it 'does not error' do
expect_any_instance_of(Foo).to receive(:bar).and_call_original
Foo.new.bar
end
it 'should not error' do
Foo.new.bar
end
end
Something in RSpec's method mocking seems to be messing with sigs method monkey-patching functionality.
Heads-up, we're currently concentrated on productizing srb init and thus we're unlikely to get to this soon.
Is this blocking your adoption? If so, would you be able to investigate a fix for this?
No problem. Yes it's blocking adoption; folks are commenting sig from methods to fix order-flaky specs. We can investigate a fix.
Thank you. For context: Stripe does not use RSpec and thus we don't have much experience typing RSpec tests.
@mdehoog https://github.com/sorbet/sorbet/pull/581 This has been merged.
Does this change the situation for you?
Most helpful comment
Heads-up, we're currently concentrated on productizing
srb initand thus we're unlikely to get to this soon.Is this blocking your adoption? If so, would you be able to investigate a fix for this?