Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

testing: update for latest rack/test

  • Loading branch information...
commit 175492c17a9ff2f8674a91b63aea0484ff9c90fa 1 parent 6c6b287
@sr sr authored
Showing with 4 additions and 3 deletions.
  1. +4 −3 testing.markdown
View
7 testing.markdown
@@ -67,7 +67,8 @@ properly:
Using `Rack::Test` without the Mixin
------------------------------------
For a variety of reasons you may not want to include `Rack::Test::Methods`
-into your own classes. `Rack::Test` supports this style of testing as well, here is the above example without using Mixin.
+into your own classes. `Rack::Test` supports this style of testing as well,
+here is the above example without using Mixin.
require 'hello_world'
@@ -79,14 +80,14 @@ into your own classes. `Rack::Test` supports this style of testing as well, her
class HelloWorldTest < Test::Unit::TestCase
def test_it_says_hello_world
- browser = Rack::Test::Session.new(Sinatra::Application)
+ browser = Rack::Test::Session.new(Rack::MockSession.new(Sinatra::Application))
browser.get '/'
assert browser.last_response.ok?
assert_equal 'Hello World', browser.last_response.body
end
def test_it_says_hello_to_a_person
- browser = Rack::Test::Session.new(Sinatra::Application)
+ browser = Rack::Test::Session.new(Rack::MockSession.new(Sinatra::Application))
browser.get '/', :name => 'Simon'
assert browser.last_response.body.include?('Simon')
end
Please sign in to comment.
Something went wrong with that request. Please try again.