Displaying 3 results from an estimated 3 matches for "test_fixture".
Did you mean:
test_fixtures
2005 Dec 31
2
Test Unit Problem
...available: 2005-12-31 06:53:00
I also have the following product_test.rb file to test the fixture
above:
require File.dirname(__FILE__) + ''/../test_helper''
class ProductTest < Test::Unit::TestCase
fixtures :products
def setup
@product = Product.find(1)
end
def test_fixtures
assert_kind_of Product, @product
assert_equal 1, @product.id
assert_equal "Dell PC", @product.title
assert_equal "Dell PC", @product.description
assert_equal "http://.../pc_image.jpg", @product.image_url
puts "class of @product.price = #{@product.pr...
2006 Mar 23
7
Fixtures just Do Not Work for Me
...iz in the rocking "Super-Her?is."
# more fixtures here
----------
My database table has columns named id, author, title, happened_at and
description as expected. My headline_test file is as follows
----------
class HeadlineTest < Test::Unit::TestCase
fixtures :headlines
def test_fixture
h = @headlines[''gita'']
puts h.title
end
end
----------
When I call the test with `ruby test/unit/headline_test'', I get the
following output:
----------------
1) Error:
test_fixture(HeadlineTest):
NoMethodError: You have a nil object when you didn&...
2006 Jun 23
0
to_yaml problem with option hash
...cording to the documentation to_yaml takes a hash of options, so
something like .to_yaml( :Indent => 4, :Separator => ''''). I''ve tried
this but the option hash has no effect, the default stay in place.
Does anyone have an idea?
Thank in advance, Bas
CODE example (test_fixture.yml):
<% hash_small = { "0"=>"1", "1"=>"2", "2"=>"3", "3"=>"4" } %>
first:
id: 1
name: Test Hash
data: <%= hash_small.to_yaml( :Indent => 8, :Separator => ''...