title: How to set the env['SERVER_NAME'] in rack/test?
body: <p>In Sinatra tests, <code>env['SERVER_NAME']</code> defaults to <code>www.example.com</code>. How can I set this to some arbitrary domain?</p>
  
  <p>Capybara has <code>.default_host</code> method, but not using Capybara.</p>
  
  <p>Or, is it possible to change the env[<code>DEFAULT_HOST</code>]?</p>
  
  <p>Using RSpec, Sinatra, WebMock.</p>
  
  <p>EDIT: Adding <code>env['SERVER_NAME'] = 'www.foo.com'</code> to RSpec test raises exception:</p>
  
  <p><code>NameError:      undefined local variable or method 'env' for #&lt;RSpec::Core::ExampleGroup::Nested_1::Nested_1:0x007fe6ce3b5ff8&gt;</code></p>