title: Setting a Path as an Environment Variable in Ruby
body: <p>I am developing a test suite for a Ruby on Rails application.  I'm testing a controller named "parser.rb" using the "<code>test_parser.rb</code>" test.  "<code>parser.rb</code>" is saved in the <code>app/controllers</code> folder while "test_parser.rb" is saved in <code>test/controllers</code>.  Right now, to use the "<code>parser.rb</code>" file, I include the following code:</p>
  
  <pre><code>require "test/unit"
  $LOAD_PATH.unshift File.expand_path '../../../app/controllers',__FILE__ 
  require "parser"
  </code></pre>
  
  <p>I would rather not have to set the load path in each test file.  I tried various Google searches for adding a load path globally, but the results focus on adding paths via the command line, or they talk about exporting environment variables without really explaining what that means.  What exactly does it mean to export an environment variable?  Does that even make sense in this context?  Ideally, I would like to include this as part of the test configurations - what changes do I have to make to which files (i.e., test_helper, environment/test/, config/environment, etc.)?</p>
  
  <p>I'm on windows 8 but I run Ruby and Rails through Cygwin.</p>