title: Setting environment variables when running Scala / SBT test suite
body: <p>I've created a Config object with a get method to return different strings based on the <code>PROJECT_ENV</code> environment variable.  If <code>PROJECT_ENV=test</code>, then <code>Config.get("somePath")</code> returns some/path.csv, otherwise it returns s3a://some_bucket/a_file.csv.</p>
  
  <pre><code>object Config {
  
    def test(): Map[String,String] = {
      Map(
        "somePath" -&gt; "some/path.csv"
      )
    }
  
    def default(): Map[String,String] = {
      Map(
        "somePath" -&gt; "s3a://some_bucket/a_file.csv"
      )
    }
  
    def get(key: String, env: Option[String] = sys.env.get("PROJECT_ENV")): String = {
      val lookupMap = if (env == Some("test")) {
        List(default(), test()).flatten.toMap
      } else {
        default()
      }
      lookupMap(key)
    }
  
  }
  </code></pre>
  
  <p>With Ruby / RSpec, I set the environment variable in the <code>spec_helper.rb</code> file with <code>ENV['PROJECT_ENV'] = 'test'</code>.  </p>
  
  <p>What is the scalatest equivalent of the <code>spec_helper.rb</code> file?  How can I set an environment variable in Scala?  <a href="https://stackoverflow.com/questions/18411478/how-to-set-environmental-variable-from-scala">This answer</a> isn't sufficient.</p>
  
  <p>My test suite runs successfully if I run <code>$ PROJECT_ENV=test sbt test</code>, but I want to simply run <code>$ sbt test</code>.</p>