Forum: Ruby on Rails Setting up Testing model, getting an error

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Mike A. (Guest)
on 2006-04-13 07:25
I setup a testing model in my Depot web app from the Agile Web
Development with Rails book and came up with the following errors:

Loaded suite test/unit/product_test
Finished in 0.050279 seconds.

  1) Error:
Errno::ENOENT: No such file or directory -

  2) Error:
NoMethodError: You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occured while evaluating nil.-

1 tests, 0 assertions, 0 failures, 2 errors


I had already created all relevant text fixtures and had already
modiefied my product_test.rb file prior to running this for my test
Malamute J. (Guest)
on 2006-05-05 16:13
im not sure if this will solve your problem but i almost had the same
error. im also learning and following the book.

make sure you dont use or insert tabs in products.yml . all the while i
thought i use spaces instead of tabs. for example:

  id:                1
  title:             Pragmatic Programmer
  description:       Best book for the programmer
  image_url:         http://localhost:3000/images/pp.jpg
  price:             29.95
  date_available:    2006-05-01 00:00:00
^^               ^^^^

in this example, all the spaces (indicated with ^) should be a space and
not tab. i kept on getting errors and i was thinking maybe because i was
using rails 1.1.2 so i reverted back to 1.0. still there were errors.
the culprit was, i didnt know i was using tabs on the start of the line
(before the key). and i thought space should be used only in between the
key and value. after that, my test was successful and solved the ENOENT

This topic is locked and can not be replied to.