Forum: Ruby on Rails unittest, not loading yml data

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.
Mohammad K. (Guest)
on 2006-03-04 05:54
(Received via mailing list)
Here is my products.yml
  id:              1
  title:           Pragmatic Version Control
  description:     How to use version control
  image_url:       /images/sk_svn_small.jpg
  price:           29.95
  date_available:  2005-01-26 00:00:00
  id:              2
  title:           Pragmatic Project Automation
  description:     How to automate your project
  image_url:       /images/sk_auto_small.jpg
  price:           29.95
  date_available:  2004-07-01 00:00:00

and I was trying to use @products and @version_control_book in my
product_test.rb script
here is my test_product.rb
require File.dirname(__FILE__) + '/../test_helper'
class ProductTest < Test::Unit::TestCase
    fixtures :products

    def setup
        @product = Product.find(1)

    def test_load_yml
        assert_equal nil, @products
        assert_equal nil, @version_control_book
        assert_equal nil, @automation_book

And here is what I am getting from product_test.rb,
[beeplove@localhost depot]$ ruby test/unit/product_test.rb
Loaded suite test/unit/product_test
Finished in 0.143878 seconds.

1 tests, 3 assertions, 0 failures, 0 errors

I was expecting to see 1 failure and 3 errors. Am I doing something

Norman T. (Guest)
on 2006-03-05 14:39
(Received via mailing list)
Am Freitag, den 03.03.2006, 22:51 -0500 schrieb Mohammad K.:
>   title:           Pragmatic Project Automation
>     fixtures :products
> end
> I was expecting to see 1 failure and 3 errors. Am I doing something wrong?

Have you set instantiated fixtures set to true in your
test/test_helper.rb file?

self.use_instantiated_fixtures = true

Norman T.
Mohammad K. (Guest)
on 2006-03-06 21:26
(Received via mailing list)
Hi Norman,

Thanks for your reply.
I think, Agile Web D. book is missing this part.

This topic is locked and can not be replied to.