Better yaml fixture error #759 [xal]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@845 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
David Heinemeier Hansson
2005-03-06 13:45:22 +00:00
parent 6cae2b7439
commit 0ceab8114c

View File

@@ -217,7 +217,7 @@ class Fixtures < Hash
yaml = YAML::load(erb_render(IO.read(yaml_file_path)))
yaml.each { |name, data| self[name] = Fixture.new(data, @class_name) } if yaml
rescue Exception=>boom
raise Fixture::FormatError, "a YAML error occured parsing #{yaml_file_path}"
raise Fixture::FormatError, "a YAML error occured parsing #{yaml_file_path}. Please note that YAML must be indented with 2,4 or 8 spaces. Tabs are not allowed. Please have a look at http://www.yaml.org/faq.html"
end
elsif File.file?(csv_file_path)
# CSV fixtures