Closed mmueller closed 11 years ago
What versions of spork and spork-minitest are you running? Can you give me the commands you are using to start spork and run the tests? Try these: bundle exec spork minitest
and bundle exec testdrb test/foo_test.rb
Versions: spork 1.0.0rc3, spork-rails 3.2.0, spork-minitest from git (c3db9e8f8089)
I'm running bundle exec spork
and SPORK_PORT=8989 bundle exec testdrb -Itest/ test/integration/**/*_test.rb
When I run spork with the minitest argument, as you suggest, the testdrb command doesn't accept the -I option anymore and without it, fails with a LoadError on my test_helper.rb file.
Thanks for your help on this.
When you run Spork server without an argument it tries to guess the test framework. It seems like you also have a spec directory for RSpec so Spork boots an RSpec server. Due to how MiniTest works, the tests run automatically when required so you see them in Spork server output accidentally.
Yes, testdrb does not support -I option. (In fact it does not have any own options at all.) It is hardcoded to include "test" directory to the load path so you can omit -Itest.
Ok, that makes sense. However, the LoadError seems to indicate that the hard-coded "test" include isn't working?
$ bundle exec testdrb test/integration/**/*_test.rb
Exception encountered: #<LoadError: cannot load such file -- test_helper>
Oh, sorry, you are using the latest 1.0 beta. It does not add "test" to load path anymore. Can you try putting $LOAD_PATH << "test"
at the very top of your test helper?
Ah, I see. testdrb looks for test_helper.rb and requires it manually. I removed the require line from my foo_test.rb files and now the tests run fine. (And the output is in the terminal where I ran the test!)
Thanks!
That works too, if you are not running tests manually outside spork.
@mmueller you should also note that your backtrace on SO shows that you're running test/unit, not minitest.
When I run testdrb, the output in the terminal is:
Meanwhile the Spork terminal contains the actual test output:
Am I doing it wrong or is this a minitest issue? Note that my rspec test output appears in the correct terminal, this only happens for my minitest tests.
Thanks!