Displaying 1 result from an estimated 1 matches for "zimp".
Did you mean:
imp
2006 Mar 01
1
maddening intermittent failures in unit tests with "working" code
...s of eyes to take a look and see if I''m mising something (my
error, rails bug?, mysql bug?).
It''s almost as though there is a race condition somewhere, or an unreliable
SQL transaction.
def reservations
# called by User object, returns count of reservations with associated Zimp
objects
# Zimp and User are AR classes mapped to MySQL schema shown later below.
count = 0
self.zimps.each { |x| count += x.reserved.to_i }
count
end
A typical unit test for this function would be to create a User object and
call the function, and check the return result
def test_workin...