Module Sinatra::TestMethods
In: lib/sinatra/test_methods.rb

These methods are for integration testing without an internet connection. They are available in Test::Unit::TestCase and when in Irb.

Methods

body   headers   html   response   status   text   xml  

Public Instance methods

body()

Alias for text

[Source]

    # File lib/sinatra/test_methods.rb, line 44
44:     def headers
45:       response.headers
46:     end
html()

Alias for text

[Source]

    # File lib/sinatra/test_methods.rb, line 29
29:     def response
30:       @response || Rack::MockResponse.new(404, {}, '')
31:     end

[Source]

    # File lib/sinatra/test_methods.rb, line 33
33:     def status
34:       response.status
35:     end

[Source]

    # File lib/sinatra/test_methods.rb, line 37
37:     def text
38:       response.body
39:     end
xml()

Alias for text

[Validate]