Closed TastyPi closed 2 months ago
Proc
also doesn't respond to bind
so isn't the code broken to begin with? This results in NoMethodError
before and after correction.
Oh, I did not realise I was getting this functionality from a gem, nevermind https://github.com/thoughtbot/shoulda-context/blob/main/lib/shoulda/context/proc_extensions.rb
Thanks for the context, that's a blast from the past. Apparently rails removed that in 4.1. Also see
https://github.com/rails/rails/pull/5552. Maybe you can also just use instance_exec
https://github.com/thoughtbot/shoulda-context/commit/e80456bb9cf3bd5e16af67b6fd077004adf6e1a2? Just a sidenote, the GC caveat doesn't apply anymore today, symbols are garbage collected.
gets turned into
but
block
doesn't have abind_call
method because it isn't a method, so this throwsNoMethodError: undefined method
bind_call' for an instance of Proc`Expected behavior
Should ignore
bind
methods called on block parameters.Actual behavior
Generates invalid code (see above)
Steps to reproduce the problem
See example above
RuboCop version