Ruby on Rails
HowtoPutSerializedColumnsInYamlFixtures

If you need/want to run tests for methods that use serialized attributes then you should brush up a bit about Ruby & YAML.

Keep in mind that rake test_units will serialze the data for you as it puts it in your test database, and write it accordingly. Here is an example record:


Blog:
  id: 1
  name: Blog
  queries: 
    recent:
      cond: "[\"publish=1 AND published_at < ?\",Time.now]"
      sort: "published_at DESC"
    draft:
      cond: "publish=0"
      sort: "created_at DESC"
    stale_drafts:
      cond: "publish=0"
      sort: "created_at ASC"

would turn the ‘queries’ column into a hash like so:


{'recent' => {'cond' => "[\"publish=1 AND published_at < ?\",Time.now]", 'sort' => "published_at DESC" },
  'draft' => { 'cond' => "", 'sort' => "created_at DESC" },
  'stale_drafts' => { 'cond' => "publish=0", 'sort' => "created_at ASC" } }