Created
May 18, 2009 20:36
-
-
Save tannerburson/113727 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #This should insert all the rack test methods into your current test context. | |
| #Modify as appropriate for your specific test framework. | |
| #If you're including the Sinatra::Test in each of your tests, you'll need to | |
| #include Rack::Test::Methods instead. | |
| Test::Unit::TestCase.send :include, Sinatra::Test | |
| #becomes | |
| Test::Unit::TestCase.send :include, Rack::Test::Methods |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #This is a pretty minor change, but probably needs to be changed in | |
| #all of your sinatra tests. | |
| before { @app = Web::Application } | |
| #becomes | |
| def app | |
| Web::Application | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #The biggest change, is that Rack::Test doesn't include a method_missing hook. | |
| #This means that this code: | |
| body.should.include 'error' | |
| #becomes | |
| last_response.body.should.include 'error' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment