diff --git a/spec/metrics_spec.rb b/spec/metrics_spec.rb index 1ae88943..1312c461 100644 --- a/spec/metrics_spec.rb +++ b/spec/metrics_spec.rb @@ -52,6 +52,10 @@ Pliny::Metrics.backends = [test_backend] end + after do + Timecop.return + end + it "measures a block's execution time with a single key" do metrics.measure(:foo) { } expect(test_backend).to have_received(:report_measures).once.with( diff --git a/spec/middleware/metrics_spec.rb b/spec/middleware/metrics_spec.rb index f4ed5e81..71150555 100644 --- a/spec/middleware/metrics_spec.rb +++ b/spec/middleware/metrics_spec.rb @@ -26,6 +26,10 @@ def app allow(Pliny::Metrics).to receive(:measure) end + after do + Timecop.return + end + it "counts total requests" do expect(Pliny::Metrics).to receive(:count).with("requests").once