2019-07-25 01:27:42 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-07-23 09:13:11 -04:00
|
|
|
RSpec::Matchers.define :increment do |counter|
|
2018-07-20 09:06:11 -04:00
|
|
|
match do |adapter|
|
2018-07-26 12:35:15 -04:00
|
|
|
expect(adapter.send(counter))
|
|
|
|
.to receive(:increment)
|
|
|
|
.exactly(@exactly || :once)
|
|
|
|
end
|
|
|
|
|
|
|
|
chain :twice do
|
|
|
|
@exactly = :twice
|
2018-07-19 04:34:58 -04:00
|
|
|
end
|
|
|
|
end
|