There's no documentation for this item.
Source Code
# File active_record/fixtures.rb, line 813 def read_fixture_file(fixture_file_path) IO.readlines(fixture_file_path).inject({}) do |fixture, line| # Mercifully skip empty lines. next if line =~ /^\s*$/ # Use the same regular expression for attributes as Active Record. unless md = /^\s*([a-zA-Z][-_\w]*)\s*=>\s*(.+)\s*$/.match(line) raise FormatError, "#{fixture_file_path}: fixture format error at '#{line}'. Expecting 'key => value'." end key, value = md.captures # Disallow duplicate keys to catch typos. raise FormatError, "#{fixture_file_path}: duplicate '#{key}' in fixture." if fixture[key] fixture[key] = value.strip fixture end end
<code/>and<pre/>for code samples.