Test unit not finding tests

100 views
Skip to first unread message

Alex N

unread,
May 16, 2011, 1:21:01 PM5/16/11
to sporkgem
I'm trying to get this working with test::unit / shoulda.

I'm running spork and testdrb both with bundle exec, but Test::Unit is
not finding my tests:

Loaded suite RequireFailedOmissions
Started
O

1) Omission: failed to load: </Users/alex/Development/rails/test/
unit/track_event_test.rb>: <no such file to load -- test/unit/
track_event_test.rb>
test_require_Users_alex_Development_rails_test_unit_track_event_test_rb(RequireFailedOmissions)

The file listed does in fact exist, and works fine when run directly
with ruby or bundle exec ruby.

Any idea why it can't find load the test?

Tim Harper

unread,
May 16, 2011, 1:24:07 PM5/16/11
to spor...@googlegroups.com
Using ruby 1.9.2?  What command are you running?

Wonder if it's due to the new requirement of ruby 1.9.2... relative requires must be declared as such by a leading "./"

Try running the same command with `testdrb ./test/unit/track_event_test.rb`

Other than that... I can't divine why you might be experiencing the issue.  Personally I use rspec.... don't use testrb... built it to show it was possible but hoped the community would take over it's maintenance. (which, largely, it has).

Tim


--
You received this message because you are subscribed to the Google Groups "sporkgem" group.
To post to this group, send email to spor...@googlegroups.com.
To unsubscribe from this group, send email to sporkgem+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/sporkgem?hl=en.


Alex N

unread,
May 16, 2011, 1:48:19 PM5/16/11
to sporkgem
Ugh, Google Groups. I replied to author by accident.

I got it working by leading with a ./ on the command line and also
changing my test_helper requires to:

require './test/test_helper'

I don't think that should be necessary. Any suggestions on ways to do
this without modifying all my requires?

Thanks!

Tim Harper

unread,
May 16, 2011, 1:57:15 PM5/16/11
to spor...@googlegroups.com


On Mon, May 16, 2011 at 11:48 AM, Alex N <al...@liivid.com> wrote:
Ugh, Google Groups. I replied to author by accident.

I got it working by leading with a ./ on the command line and also
changing my test_helper requires to:

require './test/test_helper'

I don't think that should be necessary. Any suggestions on ways to do
this without modifying all my requires?

Thanks!

Hmm... strange.

As for your workaround: in order for `require "test/test_helper"` to work in ruby 1.9.2, the only way I am aware of is for one to add your project to the $LOAD_PATH. Does TestUnit do this for you?  I am surprised, if so.  I know rspec adds the spec directory to the $LOAD_PATH such that "require 'spec_helper'" works.

Can you verify this is the case and look into it?  If so we'll want to make it happen in lib/spork/test_framework/test_unit.rb.   Would you feel comfortable hacking the code and making the change? That would be swell. Otherwise just submit a ticket and I'll get to it when I get time....

It may help to contact Yutaka HARA <yutaka.ha...@gmail.com> who submitted the ruby-1.9 patch as well and ask his opinion of this thread.

Tim

Reply all
Reply to author
Forward
0 new messages