Permalink
Browse files

avoid hardcoded loadpath

  • Loading branch information...
1 parent 9a9ffbb commit 37bfb76900908237b2d0dad63945fead21cfe340 @zhengjia committed Mar 8, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/spork/test_framework/test_unit.rb
@@ -7,7 +7,7 @@ def run_tests(argv, stderr, stdout)
# Ruby 1.9
stdout = Purdytest::IO.new(stdout) if defined? Purdytest # rewrap
MiniTest::Unit.output = stdout
-
+ old_load_path = $LOAD_PATH.dup
# MiniTest's test/unit does not support -I, -r, or -e
# Extract them and remove from arguments that are passed to testrb.
argv.each_with_index do |arg, idx|
@@ -49,7 +49,7 @@ def run_tests(argv, stderr, stdout)
config = Turn.config do |c|
c.tests = argv
c.framework = :minitest
- c.loadpath << 'test' unless c.loadpath.include?('test')
+ c.loadpath = (c.loadpath + $LOAD_PATH - old_load_path).uniq
end
controller = Turn::Controller.new(config)
controller.start

2 comments on commit 37bfb76

I'm I right in thinking this will enable me to have my tests in a different folder say "spec"?

Owner

zhengjia replied Mar 16, 2012

Exactly. Never tried it though.

I ended up not using turn anymore due to the fact that it doesn't work well with spork to provide correct stack trace on failing tests.

Please sign in to comment.