I’m working on the rails book and the test definition shown further
below
gives the following error.
test_read_with_hash(ProductTest):
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.[]
test/unit/product_test.rb:45:in `test_read_with_hash’
version_control_book:
id: 1
title: Pragmatic Version Control
description: How to use version control
image_url: http://…/sk_svn_small.jpg
price: 29.95
date_available: 2005-01-26 00:00:00
I’m clueless … Thanx a lot
Regards,
Gerard.
–
“Who cares if it doesn’t do anything? It was made with our new
Triple-Iso-Bifurcated-Krypton-Gate-MOS process …”
def test_read_with_hash
assert_kind_of Product, @product
vc_book = @products[“version_control_book”] << line 45
^
^
^
take this away
-a
===============================================================================
| ara [dot] t [dot] howard [at] noaa [dot] gov
| all happiness comes from the desire for others to be happy. all misery
| comes from the desire for oneself to be happy.
| – bodhicaryavatara
Regretfully that wasn’t it, althought the reply signs "> " had me
confused
somewhat I tried several. Removing any quotes or brackets results in
syntax
errors so that doesn’t improve.
I also tried the @products in single form @product, but that still gets
the
error:
test_read_with_hash(ProductTest):
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.[]
test/unit/product_test.rb:45:in `test_read_with_hash’
4 tests, 15 assertions, 0 failures, 1 errors
Regards,
Gerard.
On Friday 09 December 2005 01:43, [email protected] tried to type
something like:
take this away
-a
–
“Who cares if it doesn’t do anything? It was made with our new
Triple-Iso-Bifurcated-Krypton-Gate-MOS process …”
My $Grtz =~ Gerard;
~
:wq!
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.