Jim Menard [mailto:jimm / io.com] wrote:

> "Nathaniel Talbott" <ntalbott / rolemodelsoft.com> writes:
>
> > Actually, assert_equal() will work fine. Any method in Assertions can be
> > called separated either with camelCase or under_score. If you're really
> > worried about efficiency, calling camelCase methods is slightly faster,
but
> > other than that, they're exactly the same (I've overriden
> > Assertions#method_missing() to automatically convert from camelCase to
> > under_score).
>
> I haven't looked at the code yet, but wouldn't it be much
> more efficient to use
> alias_method? For example,
>
> 	alias_method :under_score, :camelCase

The reason I'm hesitant to use alias_method in this case is because it makes
a copy as opposed to a true alias. Currently, someone can easily override
any assertion in their code, and anyone calling either form of the assertion
will get the overriden method, whereas if alias_method is used, only the
form that happened to get overriden will work. Seems to make things more
brittle and less extensible. Am I misunderstanding alias_method?

One off topic question is, why isn't alias_method() named copy_method? Seems
clearer about what it actually does.


Nathaniel

<:((><
+ - -						+ - -
| RoleModel Software, Inc. &		| EQUIP VI
| The XP Software Studio(TM)		|