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