You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
RSpec/IteratedExpectation: Prefer using the all matcher instead of iterating over an array.
I'd love to convert to an all, but afaict all can't modify the expectation per element, since the expectation is dynamic based on the element. I was hoping for a syntax like
expect(dont_convert).to(all { |ascii| eq LuckySneaks::Unidecoder.decode(ascii) }) but it doesn't work.
Perfect! Thanks! You might want to include an example of converting to satisfy in the docs for the cop. I've never seen it before. One of my favorite things about rubocop is that it points me to learn knew things about writing better code that I never knew existed.
RSpec/IteratedExpectation: Prefer using the all matcher instead of iterating over an array.
I'd love to convert to an
all
, but afaictall
can't modify the expectation per element, since the expectation is dynamic based on the element. I was hoping for a syntax likeexpect(dont_convert).to(all { |ascii| eq LuckySneaks::Unidecoder.decode(ascii) })
but it doesn't work.rubocop -V
:The text was updated successfully, but these errors were encountered: