just in ram

A list of stuff I should remember but never do

Ruby testing – setup project folders

without comments

Its a good idea to keep your test cases seperate from your production code:

  myproject
      lib/
          workomatic.rb
      test/
          test_workomatic.rb

When you have your project setup in this way add the following line to the top of your test cases:

Inside test_workomatic.rb

  $:.unshift File.join(File.dirname(__FILE__), "..", "lib")
  require workomatic.rb

Written by Justin Ramel

December 5th, 2006 at 12:24 pm

Posted in Ruby, Testing

Leave a Reply