Hi RSpec list,
I have a question about the “expect { … }.to change” construct
(https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers/expect-change):
Is there an idiomatic way to test for multiple changes (i.e. chaining)?
Right now I’m doing
expect {
expect {
foobuzz
}.to change { a }
}.to change { b }
to test that calling foobuzz changes a and b. Is there a more compact
way?
(Using tap turns out rather ugly: .tap { |proc| proc.to change { a }
}. Not an improvement IMO.)
Thanks,
Jo