Permalink
Browse files

Add specs for CountRequests

  • Loading branch information...
1 parent 1727d0d commit 4466d4c0ca8ce713e558e0029391375af69cd1f8 @nextmat nextmat committed Mar 30, 2012
Showing with 28 additions and 0 deletions.
  1. +28 −0 spec/integration/metrics/middleware/count_requests_spec.rb
@@ -0,0 +1,28 @@
+require 'spec_helper'
+
+module Librato
+ module Metrics
+ module Middleware
+
+ describe CountRequests do
+ before(:all) { prep_integration_tests }
+
+ it "should count requests" do
+ CountRequests.reset
+ Metrics.submit :foo => 123
+ Metrics.submit :foo => 135
+ CountRequests.total_requests.should == 2
+ end
+
+ it "should be resettable" do
+ Metrics.submit :foo => 123
+ CountRequests.total_requests.should > 0
+ CountRequests.reset
+ CountRequests.total_requests.should == 0
+ end
+
+ end
+
+ end
+ end
+end

0 comments on commit 4466d4c

Please sign in to comment.