
Make it work with Sinatra::Base-apps
Reported by Andreas Haller | February 15th, 2009 @ 04:30 AM
Since Sinatra 0.9.0, there is this new feature where you can build multiple apps, that run in isolation and can co-exist with other Rack apps (http://www.sinatrarb.com/2009/01/18/sinatra-0.9.0.html)
You do this, by inheriting from Sinatra::Base. Like
class MyApp < Sinatra::Base
...
To run/test this app, you have to tell Sinatra::Test to run against your MyApp class, instead of Sinatra::Application.
Here's one convenient solution for this:
Webrat.configuration.application = MyApp
I've implemented this and wrote/copied a spec over here:
http://github.com/ahaller/webrat/commit/fa77b9ec3a0f8c4684c17346494...
Bye, Andreas
Comments and changes to this ticket
-
Simon Rozet February 21st, 2009 @ 08:20 PM
Here is another solution to this: http://github.com/sr/webrat/tree/sinatra-09 (it don't modify anything on Webrat)
-
Simon Rozet February 21st, 2009 @ 08:29 PM
BTW, see http://www.sinatrarb.com/extensions.html for more information on the "classic" and "modular" (which I called "classy" in my commit) app style
-
Simon Rozet February 22nd, 2009 @ 04:55 PM
I pushed this to another branch. The commit can be found on my fork
-
Bryan Helmkamp April 6th, 2009 @ 12:39 PM
- State changed from new to resolved
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
Ruby Acceptance Testing for Web applications.