While running the product_test.rb test fixture in the Agile Web
Development book (p. 148), but when I run
ruby test/unit/product_test.rb, I get the following error:
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:39:in `test_read_with_hash’
While running the product_test.rb test fixture in the Agile Web
Development book (p. 148), but when I run
ruby test/unit/product_test.rb, I get the following error:
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:39:in `test_read_with_hash’
Is there anything I need to tweak in the code to avoid seeing the error
again?
Hi,
I guess auto instantiated fixtures are now turned off by default, so
this would be products(:version_control_book); if you prefer to use the
auto instantiated fixtures turn them on in test helper.