All pastes #81279 Raw Edit

xandr

public ruby v1 · immutable
·published 2006-07-07 09:28 UTC
rendered paste body
# contents of test/fixtures/authors--- xandr:  id: 1   name: xandros# contents of test/unit/test_authors:require File.dirname(__FILE__) + '/../test_helper'class AuthorTest < Test::Unit::TestCase  fixtures :authors  def setup    @xandr= @authors["xandr"]  end  # Replace this with your real tests.  def test_truth    # assert_kind_of Author, @authors["xandr"] # ===> also failure if I comment the line in setup    assert_kind_of Author, @xandr  end  end# error:  1) Error:test_truth(AuthorTest):NoMethodError: You have a nil object when you didn't expect it!You might have expected an instance of Array.The error occured while evaluating nil.[]    ./test/unit/author_test.rb:7:in `setup_without_fixtures'    /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/fixtures.rb:548:in `setup'