This file is indexed.

/usr/share/doc/ruby-rack-test/README.rdoc is in ruby-rack-test 0.6.2-2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
= Rack::Test {<img src="https://codeclimate.com/badge.png" />}[https://codeclimate.com/github/brynary/rack-test]

- Code: 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

== Examples

  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


If you want to test one app in isolation, you just return that app as shown above. But if you want to test the entire app stack, including middlewares, cascades etc. you need to parse the app defined in config.ru.

    OUTER_APP = Rack::Builder.parse_file('config.ru').first

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

      def app
        OUTER_APP
      end

      def test_root
        get '/'
        assert last_response.ok?
      end
    end


== Install

To install the latest release as a gem:

  sudo gem install rack-test

Or via Bundler:

  gem "rack-test", require: "rack/test"

== Authors

- Maintained by {Bryan Helmkamp}[mailto:bryan@brynary.com]
- Contributions from Simon Rozet, Pat Nakajima and others
- 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.

== Releasing

* Ensure History.txt is up-to-date
* Bump VERSION in lib/rack/test.rb
* thor :release