OK, here's a simple unit test that passes:

#! /usr/bin/env ruby
require 'citeproc'
require 'test/unit'

class TestReference < Test::Unit::TestCase
  include CiteProc
  def data
    [
      {
        :creator => ["Doe, Jane", "Jane Doe"],
        :title => "Some title",
        :year => "1999",
        :type => "book"
      }
    ]
  end

  def test_load
    data.each do |reference|
      t = reference[:title]
      y = reference[:year]
      ty = reference[:type]
      au = reference[:creator].each{|a| Person.new(a[0], a[1])}
      Reference.new(title=t, creator=au, year=y, type=ty)
    end
  end
end

I still need to wrap my head around this (particularly exactly what kinds of methods to create tests for), but I guess the idea is to create a file full of this sort of stuff?

Bruce

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to