Skip to content

Commit

Permalink
Mention that you have to return Sinatra::Application from def app
Browse files Browse the repository at this point in the history
  • Loading branch information
tannerburson committed May 18, 2009
1 parent 7a7fd4c commit 86f6eb3
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions testing.markdown
Expand Up @@ -50,6 +50,10 @@ properly:
class HelloWorldTest < Test::Unit::TestCase
include Rack::Test::Methods

def app
Sinatra::Application
end

def test_it_says_hello_world
get '/'
assert last_response.ok?
Expand Down Expand Up @@ -118,6 +122,13 @@ subclasses, simply set the `app` method to return your particular class.
MySinatraApp
end

If you're using a classic style Sinatra application, then you need to return an
instance of `Sinatra::Application`.

def app
Sinatra::Application
end

### Making `Rack::Test` available to all test cases

If you'd like the `Rack::Test` methods to be available to all test cases
Expand Down

0 comments on commit 86f6eb3

Please sign in to comment.