From: dblack@... Date: 2006-08-30T06:02:26+09:00 Subject: Re: Test::Unit::TestCase not resolving correctly Hi -- On Wed, 30 Aug 2006, dkmd_nielsen@hotmail.com wrote: > In the assignment of the class variable value, the first assert_equal s/class variable/instance variable/ > test case appears to be comparing the expected value to the input of > the class variable assignment...not the value returned by the > assigment. An assignment returns its right-hand side. This rule applies even to pseudo-assignment method calls: class C attr_reader :x def x=(y) @x = 100 end end c = C.new p c.x = 1 # prints 1, not 100 p c.x # prints 100 The idea is to make the assignment-like method calls truly assignment-like. David -- David A. Black | dblack@wobblini.net Author of "Ruby for Rails" [1] | Ruby/Rails training & consultancy [3] DABlog (DAB's Weblog) [2] | Co-director, Ruby Central, Inc. [4] [1] http://www.manning.com/black | [3] http://www.rubypowerandlight.com [2] http://dablog.rubypal.com | [4] http://www.rubycentral.org