# NoMethodError: nil object with Autotest/ZenTest

**URL:** <https://www.ruby-forum.com/t/nomethoderror-nil-object-with-autotest-zentest/127892>\
**Category:** Rails\
**Created:** [February 2, 2008, 7:21am UTC](https://www.ruby-forum.com/t/nomethoderror-nil-object-with-autotest-zentest/127892 "2008-02-02T07:21:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeff](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e19b73/32.png) [@jeff](https://www.ruby-forum.com/u/jeff)\
**Post date:** [February 2, 2008, 7:21am UTC](https://www.ruby-forum.com/t/nomethoderror-nil-object-with-autotest-zentest/127892/1 "2008-02-02T07:21:48Z")

</div>

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:in`setup\_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

---

<div class="post-metadata">

**Author:** ![jeff](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e19b73/32.png) [@jeff](https://www.ruby-forum.com/u/jeff)\
**Post date:** [February 6, 2008, 12:23am UTC](https://www.ruby-forum.com/t/nomethoderror-nil-object-with-autotest-zentest/127892/2 "2008-02-06T00:23:21Z")

</div>

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:in`setup\_without\_fixtures’  
/home/kenglish/workspace/first2/vendor/rails/activerecord/lib/  
active\_record/fixtures.rb:979:in `full\_setup’
