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
|