NoMethodError: nil object with Autotest/ZenTest

Hello,

I’m attempting to get started with ZenTest and Autotest, but I haven’t
had any luck getting it to run even the simplest test so far. I
created a fresh Rails app, made sure the latest ZenTest gem (3.9.1)
was installed, altered test_helper.rb and Rakefile as directed, and
tried to run “autotest -rails”.

I have a database model called “things”, and a single test of the
View, Unit and Functional type. The View test includes only a test
for the “index” page.

When I run autotest, here’s the result:

C:\rails\funk>autotest -rails
loading autotest/rails
C:\ruby\bin\ruby -I.;lib;test -rtest/unit -e “%w[test/functional/
things_controll
er_test.rb test/views/thing_view_test.rb test/unit/thing_test.rb].each
{ |f| req
uire f }” | unit_diff -u
Loaded suite -e
Started
.E
Finished in 1.266 seconds.

  1. Error:
    test_index(ThingViewTest):
    NoMethodError: You have a nil object when you didn’t expect it!
    You might have expected an instance of Array.
    The error occurred while evaluating nil.split
    C:/ruby/lib/ruby/gems/1.8/gems/ZenTest-3.9.1/lib/test/rails.rb:
    276:in path2 class' C:/ruby/lib/ruby/gems/1.8/gems/ZenTest-3.9.1/lib/test/rails/ functional_test_ case.rb:28:insetup_without_fixtures’
    C:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/
    active_record/fixtures
    .rb:979:in `full_setup’

2 tests, 1 assertions, 0 failures, 1 errors

Does anyone know why this might be happening? I get no errors when I
change my test_helper and Rakefile back to Test::Unit and run “rake”.
But this happens with ZenTest and autotest. I’d love to use them if
I can figure out what’s going on.

Thanks!
Jeff C.man

I’m having the same issue, just upgraded to rails 2.0.2 from 1.2.3 and
getting the same error:

NoMethodError: You have a nil object when you didn’t expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.split
/usr/lib/ruby/gems/1.8/gems/ZenTest-3.9.1/lib/test/rails.rb:276:in
path2class' /usr/lib/ruby/gems/1.8/gems/ZenTest-3.9.1/lib/test/rails/ functional_test_case.rb:28:insetup_without_fixtures’
/home/kenglish/workspace/first2/vendor/rails/activerecord/lib/
active_record/fixtures.rb:979:in `full_setup’

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs