Reputation: 175
I 'm trying to make a of my first application on ruby ... Thats's my test file
require File.dirname(__FILE__) + '/../test_helper'
class SupplierTest < ActiveSupport::TestCase
fixtures :suppliers
def test_name
supplier=Supplier.create(:name => 'juan' , :province => nil)
assert_equal 'juan' , supplier.get_name
end
end
and the fixture
juan:
id:1
name:juan
province:nil
and the result is
Psych::SyntaxError: (<unknown>): could not find expected ':' while scanning a simple key at line 8 column 1
Upvotes: 0
Views: 1956
Reputation: 37409
YAML requires a space between the :
and the value, so try updating your fixture to:
juan:
id: 1
name: juan
province:
(writing nil
in province will result in the value "nil"
. Leaving it empty will result in a true nil
value)
Upvotes: 1