Skip to content

Instantly share code, notes, and snippets.

@jc00ke
Created January 17, 2011 04:27
Show Gist options
  • Save jc00ke/782488 to your computer and use it in GitHub Desktop.
Save jc00ke/782488 to your computer and use it in GitHub Desktop.
Use Rack::Builder.parse_file to test your config.ru
require 'minitest/autorun'
require 'minitest/spec'
require 'rack/test'
describe "config.ru" do
include Rack::Test::Methods
def app
# parse_file returns an array, but we need a rack app
Rack::Builder.parse_file('path/to/your/config.ru').first
end
it "should have redirects" do
get "/old"
follow_redirects!
last_request.path.must_equal "/new"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment