Today I Learned

hashrocket A Hashrocket project

Partial RSpec argument matches

Sometimes when testing you want to verify that a set of arguments was passed to a method. However, you may not care about all of the arguments, maybe just a subset.

RSpec-Mocks has the idea of partial matching built in.

expect(double).to receive(:msg).with(hash_including(much: "wow"))

See More #testing TILs