[#4567] Re: What's the biggest Ruby development? — Aleksi Niemel<aleksi.niemela@...>

Dave said:

18 messages 2000/08/23
[#4568] Q's on Marshal — Robert Feldt <feldt@...> 2000/08/23

[#4580] RubyUnit testcase run for different init params? — Robert Feldt <feldt@...> 2000/08/25

[#4584] Re: RubyUnit testcase run for different init params? — Dave Thomas <Dave@...> 2000/08/25

Robert Feldt <feldt@ce.chalmers.se> writes:

[#4623] Re: RubyUnit testcase run for different init params? — Robert Feldt <feldt@...> 2000/08/28

On Sat, 26 Aug 2000, Dave Thomas wrote:

[#4652] Andy and Dave's European Tour 2000 — Dave Thomas <Dave@...>

24 messages 2000/08/30
[#4653] Re: Andy and Dave's European Tour 2000 — matz@... (Yukihiro Matsumoto) 2000/08/30

Hi,

[#4657] Ruby tutorials for newbie — Kevin Liang <kevin@...> 2000/08/30

Hi,

[ruby-talk:04454] Re: Few random notes

From: Dave Thomas <Dave@...>
Date: 2000-08-13 14:15:58 UTC
List: ruby-talk #4454
Aleksi Niemel<aleksi.niemela@cinnober.com> writes:

> RubyUnit assertions should be added to object too (on request), so
> instead of

Firstly, I appreciate the 'on request' part of this--I personally
wouldn't want this behavior, so I like the fact you're suggesting
making it optional. Let me tell you _why_ I wouldn't use it, and
perhaps you might think twice too.

When you test something, one of the unwritten rules is that you modify 
it as little as possible--any change may modify the behavior of the
thing under test, so that when the tests are removed, it fails (or at
least acts differently).

By adding 10 or so methods to Object, you're changing potential
behavior of every single object in the system. This is a fairly big
step to take, so I personally would avoid doing it.

On a less pedantic note, I also think it's easier to see tests in the
code if they're written as

     assert_equal(99, i)

rather than

     i.assert_equal(99)


Regards


Dave

In This Thread

Prev Next