dimensions icon indicating copy to clipboard operation
dimensions copied to clipboard

Fix require in tests in Ruby 1.9

Open ai opened this issue 11 years ago • 1 comments

Ruby 1.9 doesn’t has . in $LOAD_PATH, so we need another way to require test helper to run tests.

ai avatar Jun 16 '13 05:06 ai

Relative requires are hard to write and maintain. The common solution to this problem is to have the test runner (in this case, the rake task) put test/ onto RUBYLIB. This is what RSpec does with spec/ directory by default.

Rake::TestTask.new do |t|
  t.libs << 'test'
  t.verbose = true
  t.warning = true
end

mislav avatar Jun 16 '13 11:06 mislav