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