Unit Tests Take 2


#1

Different question this time, and maybe only a core developer can
answer.

In 1.0, use_instantiated_fixtures is turned off by default. What is the
new
best-practice for not tying your tests to your test data?

Before you would use:

In clients.yml

first_client:

id: 1

name: Fred

In a test case:

def test_sometest

assert_equal @first_client.name, @client.name

end

With this setting turned off be default, for obvious reasons, is there a
different method of doing the test so it is not dependent on the actual
data?

Thanks guys.

Bob S.

http://www.railtie.net/


#2

On Jan 27, 2006, at 11:46 PM, Bob S. wrote:

Before you would use:

assert_equal @first_client.name, @client.name

end

With this setting turned off be default, for obvious reasons, is
there a different method of doing the test so it is not dependent
on the actual data?
assert_equal clients(:first_client).name, @client.name