title: How do you set up Rack::URLMap to work with RSpec in Sinatra?
body: <p>I'm relatively new to Sinatra, and I want to figure out a way to integrate RSpec with my Sinatra setup.</p>
  
  <p>config.ru</p>
  
  <pre><code>require 'sinatra'
  require 'mongoid'
  require 'uri'
  require './lib/twilio_wrapper'
  
  Mongoid.load!("./config/mongoid.yml")
  
  Dir["./controllers/*.rb"].each { |file| require file }
  
  run Rack::URLMap.new(
    '/' =&gt; HomeController.new,
    '/users' =&gt; UsersController.new(TwilioWrapper.new)
  )
  </code></pre>
  
  <p>With this setup, I can modularize my controllers and create single instances of helper classes (such as TwilioWrapper). However, if I want to set up RSpec, I need to point it to my application's class. However, in the situation above, because I'm using Rack::URLMap, I don't have a specific application class to point RSpec to. </p>
  
  <p>How can I keep my code modular in the fashion outlined above while including RSpec for tests?</p>