Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Readme

  • Loading branch information...
commit ae1b5f3fb8dfcac5090cbff330fd637bd9efc3ae 1 parent e514555
Bryan Helmkamp authored
4 .document
View
@@ -0,0 +1,4 @@
+README.rdoc
+lib/**/*.rb
+History.txt
+MIT-LICENSE.txt
1  .gitignore
View
@@ -1 +1,2 @@
pkg
+doc
2  MIT-LICENSE.txt
View
@@ -1,4 +1,4 @@
-Copyright (c) 2008 Bryan Helmkamp, Engine Yard Inc.
+Copyright (c) 2008-2009 Bryan Helmkamp, Engine Yard Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
0  README
View
No changes.
54 README.rdoc
View
@@ -0,0 +1,54 @@
+= Rack::Test
+
+- http://gitrdoc.com/brynary/rack-test
+- http://github.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
+
+ def test_redirect_logged_in_users_to_dashboard
+ session = Rack::Test::Session.new(MyApp.new)
+
+ session.authorize "bryan", "secret"
+ session.get "/"
+ session.follow_redirect!
+
+ assert_equal "http://example.org/redirected", session.last_request.url
+ assert session.last_response.ok?
+ end
+
+ end
+
+== Install
+
+To install the latest release as a gem:
+
+ sudo gem install rack-test
+
+== Authors
+
+- Maintained by {Bryan Helmkamp}[mailto:bryan@brynary.com]
+- Contributions from Simon Rozet and Pat Nakajima
+- Much of the original code was extracted from Merb 1.0's request helper
+
+== License
+
+Copyright (c) 2008-2009 Bryan Helmkamp, Engine Yard Inc.
+See MIT-LICENSE.txt in this directory.
20 Rakefile
View
@@ -1,8 +1,9 @@
require "rubygems"
+require "rake/rdoctask"
require "rake/gempackagetask"
require "rake/clean"
require "spec/rake/spectask"
-require "./lib/rack/test"
+require File.expand_path("./lib/rack/test")
Spec::Rake::SpecTask.new do |t|
t.spec_opts == ["--color"]
@@ -19,15 +20,30 @@ spec = Gem::Specification.new do |s|
s.homepage = "http://github.com/brynary/rack-test"
s.summary = "Simple testing API built on Rack"
s.description = s.summary
- s.files = %w[Rakefile] + Dir["lib/**/*"]
+ s.files = %w[Rakefile README.rdoc] + Dir["lib/**/*"]
+
+ # rdoc
+ s.has_rdoc = true
+ s.extra_rdoc_files = %w(README.rdoc MIT-LICENSE.txt)
end
Rake::GemPackageTask.new(spec) do |package|
package.gem_spec = spec
end
+desc "Delete generated RDoc"
+task :clobber_docs do
+ FileUtils.rm_rf("doc")
+end
+
+desc "Generate RDoc"
+task :docs => :clobber_docs do
+ system "hanna --title 'Rack::Test #{Rack::Test::VERSION} API Documentation'"
+end
+
desc 'Install the package as a gem.'
task :install => [:clean, :package] do
gem = Dir['pkg/*.gem'].first
sh "sudo gem install --local #{gem}"
end
+
Please sign in to comment.
Something went wrong with that request. Please try again.