(Please consider adding support for matching argument) To allow not only the exact argument but also its regular expressions or any non-nil arguments to pass.
Thanks for your support and help.
# old
SlackApi.sidekiq_delay.post_to('message')
expect(SlackApi.method :post_to).to be_delayed('message') #=> OK
expect(SlackApi.method :post_to).to be_delayed #=> NG
expect(SlackApi.method :post_to).to be_delayed(/^message/) #=> NG
expect(SlackApi.method :post_to).to be_delayed(any_args) #=> NG
# new
SlackApi.sidekiq_delay.post_to('message')
expect(SlackApi.method :post_to).to be_delayed('message') #=> OK
expect(SlackApi.method :post_to).to be_delayed #=> NG
expect(SlackApi.method :post_to).to be_delayed(/^message/) #=> OK
expect(SlackApi.method :post_to).to be_delayed(any_args) #=> OK
Coverage increased (+0.8%) to 97.79% when pulling ab42fa43016173356e876688781dabdcaf70087a on coincheckjp:support-matching-arguments into 12135312a7868353a51586bf97489dd2c3f0846d on philostler:develop.
Coverage increased (+0.8%) to 97.79% when pulling ab42fa43016173356e876688781dabdcaf70087a on coincheckjp:support-matching-arguments into 12135312a7868353a51586bf97489dd2c3f0846d on philostler:develop.
(Please consider adding support for matching argument) To allow not only the exact argument but also its regular expressions or any non-nil arguments to pass. Thanks for your support and help.
See also: https://relishapp.com/rspec/rspec-mocks/v/3-1/docs/setting-constraints/matching-arguments
Examples: