Skip to content

Instantly share code, notes, and snippets.

@brynary
Created March 14, 2009 21:30
Show Gist options
  • Save brynary/79191 to your computer and use it in GitHub Desktop.
Save brynary/79191 to your computer and use it in GitHub Desktop.
require File.dirname(__FILE__) + '/../spec_helper'
require "rack/test"
require "webrat"
describe Rack::Bug do
include Rack::Test::Methods
include Webrat::Matchers
def app
Rack::Bug::Middleware.new(SampleApp.new)
end
it "should return the correct Content-Length" do
response = get "/"
response["Content-Length"].should == response.body.join.size.to_s
end
it "should track the elapsed time" do
response = get "/"
response.should contain(/\d+\.\d+ms/)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment