Skip to content
This repository was archived by the owner on Jun 10, 2018. It is now read-only.

Comments

Fix require in tests in Ruby 1.9#6

Open
ai wants to merge 1 commit intosstephenson:masterfrom
ai:fix_tests
Open

Fix require in tests in Ruby 1.9#6
ai wants to merge 1 commit intosstephenson:masterfrom
ai:fix_tests

Conversation

@ai
Copy link

@ai ai commented Jun 16, 2013

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

@mislav
Copy link

mislav commented Jun 16, 2013

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants