I'm making a secured web service using Sinatra. It requires SSL and a security token sent with every request. Therefore I've made a simple middleware that checks each incoming request for a security token, and denies the request if it's missing or invalid.
module MyWebService
class App < Sinatra::Base
use MyWebService::Security
# ...
end
end
However, this obviously made my large test suite of validation tests fail, because they were written before I added security to the web service.
Is there any way to simply disable the middleware after it has been enabled? That way my entire test suite would still function, and I could test the security middleware separately.