Skip to content
This repository has been archived by the owner on Dec 8, 2023. It is now read-only.

Commit

Permalink
Test fixes - happy within suite.
Browse files Browse the repository at this point in the history
  • Loading branch information
pat committed Aug 25, 2012
1 parent 6ba7b48 commit 02df1a9
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions test/unit/middleware_test.rb
Expand Up @@ -3,14 +3,23 @@
require 'metrics/rails'

class MetricRackMiddlewareTest < MiniTest::Unit::TestCase
include Mocha::API

def setup
Metrics::Rails.stubs(:forking_server?).returns(false)
Metrics::Rails.stubs(:measure).returns(true)
Metrics::Rails.stubs(:increment).returns(true)

Time.stubs(:now).returns(0.1305, 0.20075)
Time.stubs(:now).returns(Time.at(0.1305), Time.at(0.20075))

@middleware = Metrics::Rack::Middleware.new(
stub(:call => [200, {}, []]), Metrics::Rails
)
end

@middleware = Metrics::Rack::Middleware.new stub(:call => [200, {}, []])
def teardown
Metrics::Rails.unstub :forking_server?, :measure, :increment
Time.unstub :now
end

def test_logs_header_metrics
Expand Down

0 comments on commit 02df1a9

Please sign in to comment.