RSpec matcher that checks collection to include item that satisfies lambda
问题 I am a bit at a loss as to how to write a RSpec 3.2.x spec that checks wether a list contains at least one item that satisfies a condition. Here is an example: model = Invoice.new model.name = 'test' changes = model.changes expect(changes).to include { |x| x.key == 'name' && x.value == 'test' } There will be other (automated) changes in the changes list too so I don't want to verify that there is only one specific change and I also don't want to rely on ordering expect(changes.first)... so I