From: Chris Morris Date: 2001-11-06T08:33:32+09:00 Subject: [ruby-talk:24434] Re: Detect future method calls in method_mi ssing? > Ok, sorry to keep on about this, but I'm clearly missing something. You > say that you're modifying calls like > > foo.anElement = bar > > to > > foo.anElement.value = bar > > But that's a completely different method call (:anElement=) from the > method call :anElement, which is what is sent by > > foo.anElement.checked = bar. > > So I don't see how the fact that you're intercepting and changing calls to > :anElement= has any effect (or has to have any effect) on calls to > :anElement. > > Can you enlighten me? Ah, I see. I haven't been clear in regard to anElement= and anElement, I've only really mentioned anElement=. I'm intercepting *both* anElement= and anElement and replacing them with anElement.value= and anElement.value (or .checked, etc.). This allows the acceptance test script to be: form.aTextInput = 'newValue' form.aCheckbox = true assert_equals('newValue', form.aTextInput) assert_equals(true, form.aCheckbox) instead of: form.aTextInput.value = 'newValue' form.aCheckbox.checked = true assert_equals('newValue', form.aTextInput.value) assert_equals(true, form.aCheckbox.checked) Chris