Closed schneems closed 1 year ago
Huh, this surprises me... We generally take care not to monkey patch where possible, so only certain top level methods like describe
and the shared example stuff should be available, I'll investigate but no monkey patching will be the default in 4.
Can you check the source location of that method for me? I get the "correct" behaviour:
NoMethodError:
undefined method `before' for main:Object
It looks like you're right, it's coming from sinatra, not from rspec
puts method(:before)
# => #<Method: Object(Sinatra::Delegator)#before(*args, &block) /Users/rschneeman/.gem/ruby/3.1.4/gems/sinatra-3.1.0/lib/sinatra/base.rb:2036>
Thanks for checking ❤️
Expected
If I add this code to my
spec_helper.rb
it should either run or error:Actual
It does nothing. It is valid code (so it doesn't raise an error), but the code inside is never executed. You can verify by changing the
puts
to araise
.Ideally I would get an error (or warning if we cannot be certain) like:
Versions