Skip to content

Instantly share code, notes, and snippets.

@knaveofdiamonds
Created March 9, 2009 20:30
Show Gist options
  • Save knaveofdiamonds/76456 to your computer and use it in GitHub Desktop.
Save knaveofdiamonds/76456 to your computer and use it in GitHub Desktop.
Sinatra::Default.set(:environment, :test)
module RackTestSinatra
include Rack::Test::Methods
def app
Sinatra::Application
end
alias :response :last_response
alias :request :last_request
alias :follow! :follow_redirect!
def method_missing(name, *args, &block)
if response && response.respond_to?(name)
response.send(name, *args, &block)
else
super
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment