When mocking and stubbing Ruby code with RSpec, it can be helpful to use argument matchers to expect an object to receive a method call with various types of arguments. This is an advanced RSpec feature, but one that is particularly useful when testing conditional method call arguments.
View the source for this episode: https://github.com/brettchalupa/screencasts/tree/master/rspec-arg-matchers-explained
RSpec docs on this feature: https://relishapp.com/rspec/rspec-mocks/docs/setting-constraints/matching-arguments