rspec-expectations icon indicating copy to clipboard operation
rspec-expectations copied to clipboard

Allow `satisfy` to match the block expectation return value

Open pirj opened this issue 6 months ago • 2 comments

fixes https://github.com/rspec/rspec-expectations/issues/1466 idea https://github.com/rspec/rspec-expectations/issues/805#issuecomment-494380144

ary = [1, 2]
expect { ary.shift }
  .to change { ary }.to([2])
  .and satisfy { |returned_value| returned_value == 1 }

pirj avatar Aug 04 '24 17:08 pirj