spec/flipper/adapters/sync/interval_synchronizer_spec.rb in flipper-0.13.0 vs spec/flipper/adapters/sync/interval_synchronizer_spec.rb in flipper-0.14.0
- old
+ new
@@ -12,23 +12,23 @@
expect(events.size).to be(0)
subject.call
expect(events.size).to be(1)
end
- it "only invokes wrapped synchronizer every interval milliseconds" do
+ it "only invokes wrapped synchronizer every interval seconds" do
now = described_class.now_ms
subject.call
events.clear
# move time to one millisecond less than last sync + interval
1.upto(interval) do |i|
- allow(described_class).to receive(:now_ms).and_return(now + i - 1)
+ allow(described_class).to receive(:now_ms).and_return(now + (i * 1_000) - 1)
subject.call
end
expect(events.size).to be(0)
- # move time to last sync + interval
- allow(described_class).to receive(:now_ms).and_return(now + interval)
+ # move time to last sync + interval in milliseconds
+ allow(described_class).to receive(:now_ms).and_return(now + (interval * 1_000))
subject.call
expect(events.size).to be(1)
end
end