title: Ruby 'require' and File Suffixes
body: <p>I have two files: </p>
  
  <ol>
  <li><p>A Ruby file that contains both a class definition and a sample script. This is simply called '<em>foo</em>' since I would like to run it as an executable in certain circumstances.</p></li>
  <li><p>A Ruby test script named '<em>bar.rb</em>' that tests the tests that methods of '<em>foo</em>.' </p></li>
  </ol>
  
  <p>When trying to include '<em>foo</em>' in '<em>bar.rb</em>' I encounter a require error: </p>
  
  <pre><code>gem_original_require': no such file to load -- foo (LoadError)
  </code></pre>
  
  <p>However, if I rename '<em>foo</em>' to '<em>foo.rb</em>' the problem disappears! From my understanding, the Ruby 'require' method should be able to load data even from non '*.rb' files.</p>
  
  <p>Is there a way to import the functionality of '<em>foo</em>' without changing the file suffix? Does anyone have an explanation for the behavior exhibited?</p>