github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

brynary / rack-test

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 177
    • 14
  • Source
  • Commits
  • Network (14)
  • Issues (0)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (2)
    • gh-pages
    • master ✓
  • Tags (10)
    • v0.5.3
    • v0.5.2
    • v0.5.1
    • v0.5.0
    • v0.4.2
    • v0.4.1
    • v0.4.0
    • v0.3.0
    • v0.2.0
    • v0.1.0
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

Rack::Test is a layer on top of Rack's MockRequest similar to Merb's RequestHelper — Read more

  cancel

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

Update gemspec as well 
brynary (author)
Fri Nov 27 13:46:59 -0800 2009
commit  f4167b71026eb663febd2fa610a622c3627f99a7
tree    7629986248d34dce3e88ac6d841be52b87407994
parent  240c3a52f6d9b83a1299a77ffbf5b9f09d7583b7
rack-test /
name age
history
message
file .document Mon Mar 02 19:45:51 -0800 2009 Readme [brynary]
file .gitignore Sat Sep 19 11:48:10 -0700 2009 Ignore VERSION file in git [brynary]
file History.txt Fri Nov 27 13:45:02 -0800 2009 Prep for 0.5.3 release [brynary]
file MIT-LICENSE.txt Mon Mar 02 19:45:51 -0800 2009 Readme [brynary]
file README.rdoc Sat Sep 19 14:07:05 -0700 2009 Docs [brynary]
file Rakefile Mon Oct 26 22:11:03 -0700 2009 Use a simple Thorfile for release (to Gemcutter... [brynary]
file Thorfile Mon Oct 26 22:11:03 -0700 2009 Use a simple Thorfile for release (to Gemcutter... [brynary]
directory lib/ Fri Nov 27 13:46:21 -0800 2009 Bump VERSION constant to pre-release [brynary]
file rack-test.gemspec Fri Nov 27 13:46:59 -0800 2009 Update gemspec as well [brynary]
directory spec/ Fri Nov 27 13:29:33 -0800 2009 Fix cookie matching for subdomains [sickill]
README.rdoc

Rack::Test

  • Code: github.com/brynary/rack-test
  • Build: runcoderun.com/brynary/rack-test

Description

Rack::Test is a small, simple testing API for Rack apps. It can be used on its own or as a reusable starting point for Web frameworks and testing libraries to build on. Most of its initial functionality is an extraction of Merb 1.0’s request helpers feature.

Features

  • Maintains a cookie jar across requests
  • Easily follow redirects when desired
  • Set request headers to be used by all subsequent requests
  • Small footprint. Approximately 200 LOC

Example

  require "rack/test"

  class HomepageTest < Test::Unit::TestCase
    include Rack::Test::Methods

    def app
      MyApp.new
    end

    def test_redirect_logged_in_users_to_dashboard
      authorize "bryan", "secret"
      get "/"
      follow_redirect!

      assert_equal "http://example.org/redirected", last_request.url
      assert last_response.ok?
    end

  end

Install

To install the latest release as a gem:

  sudo gem install rack-test

Authors

  • Maintained by Bryan Helmkamp
  • Contributions from Simon Rozet and Pat Nakajima
  • Much of the original code was extracted from Merb 1.0’s request helper

License

Copyright © 2008-2009 Bryan Helmkamp, Engine Yard Inc. See MIT-LICENSE.txt in this directory.

Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server