[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ruby-talk
Subject:    Re: assertions in Ruby
From:       "Volkmann, Mark" <Mark.Volkmann () AGEDWARDS ! com>
Date:       2002-10-04 18:07:53
[Download RAW message or body]

> -----Original Message-----
> From: Alan Chen [mailto:alan@digikata.com]
> Sent: Friday, October 04, 2002 11:37 AM
> To: ruby-talk@ruby-lang.org
> Subject: Re: assertions in Ruby
> 
> On Fri, Oct 04, 2002 at 10:43:46PM +0900, Volkmann, Mark wrote:
> > 
> > Is anyone aware of a Ruby module that adds support for 
> assertions such as what
> > is supported in Java 1.4?  I wrote such a thing yesterday 
> and am considering
> > releasing it if I'm not duplicating what someone else has 
> already done.
> > I've included some examples below showing how mine is used.
> 
> I have an unreleased, partailly completed module which include the
> Test::Unit asserts when $DEBUG is set and do nothing otherwise. It
> looks almost the same as yours.  The only suggestion I have is maybe
> working it in with the Ruby::Unit or Test::Unit frameworks.

I'm not quite convinced that assertions should be integrated with a unit
testing framework. They seem fundamentally different to me.

With assertions enabled, an application generally stops as soon as one
fails.  Results are not collected into a report since only one failure is
reported.  Assertions go in the code and remain there for documentation
purposes.

With unit tests, tests continue even if one fails.  Results are collected
into a report.  Unit tests go in a separate class written exclusively for
testing purposes.

What kinds of things do you envision that an assertion framework borrow from
a unit testing framework?


***********************************************************************************
WARNING:  All e-mail sent to and from this address will be received or
otherwise recorded by the A.G. Edwards corporate e-mail system and is
subject to archival, monitoring or review by, and/or disclosure to,
someone other than the recipient.
************************************************************************************

[Attachment #3 (text/html)]

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2653.12">
<TITLE>RE: assertions in Ruby</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=2>&gt; -----Original Message-----</FONT>
<BR><FONT SIZE=2>&gt; From: Alan Chen [<A \
HREF="mailto:alan@digikata.com">mailto:alan@digikata.com</A>]</FONT> <BR><FONT \
SIZE=2>&gt; Sent: Friday, October 04, 2002 11:37 AM</FONT> <BR><FONT SIZE=2>&gt; To: \
ruby-talk@ruby-lang.org</FONT> <BR><FONT SIZE=2>&gt; Subject: Re: assertions in \
Ruby</FONT> <BR><FONT SIZE=2>&gt; </FONT>
<BR><FONT SIZE=2>&gt; On Fri, Oct 04, 2002 at 10:43:46PM +0900, Volkmann, Mark \
wrote:</FONT> <BR><FONT SIZE=2>&gt; &gt; </FONT>
<BR><FONT SIZE=2>&gt; &gt; Is anyone aware of a Ruby module that adds support for \
</FONT> <BR><FONT SIZE=2>&gt; assertions such as what</FONT>
<BR><FONT SIZE=2>&gt; &gt; is supported in Java 1.4?&nbsp; I wrote such a thing \
yesterday </FONT> <BR><FONT SIZE=2>&gt; and am considering</FONT>
<BR><FONT SIZE=2>&gt; &gt; releasing it if I'm not duplicating what someone else has \
</FONT> <BR><FONT SIZE=2>&gt; already done.</FONT>
<BR><FONT SIZE=2>&gt; &gt; I've included some examples below showing how mine is \
used.</FONT> <BR><FONT SIZE=2>&gt; </FONT>
<BR><FONT SIZE=2>&gt; I have an unreleased, partailly completed module which include \
the</FONT> <BR><FONT SIZE=2>&gt; Test::Unit asserts when $DEBUG is set and do nothing \
otherwise. It</FONT> <BR><FONT SIZE=2>&gt; looks almost the same as yours.&nbsp; The \
only suggestion I have is maybe</FONT> <BR><FONT SIZE=2>&gt; working it in with the \
Ruby::Unit or Test::Unit frameworks.</FONT> </P>

<P><FONT SIZE=2>I'm not quite convinced that assertions should be integrated with a \
unit testing framework. They seem fundamentally different to me.</FONT></P>

<P><FONT SIZE=2>With assertions enabled, an application generally stops as soon as \
one fails.&nbsp; Results are not collected into a report since only one failure is \
reported.&nbsp; Assertions go in the code and remain there for documentation \
purposes.</FONT></P>

<P><FONT SIZE=2>With unit tests, tests continue even if one fails.&nbsp; Results are \
collected into a report.&nbsp; Unit tests go in a separate class written exclusively \
for testing purposes.</FONT></P>

<P><FONT SIZE=2>What kinds of things do you envision that an assertion framework \
borrow from a unit testing framework?</FONT> </P>

<CODE><FONT SIZE=3><BR>
<BR>
***********************************************************************************<BR>
                
WARNING:  All e-mail sent to and from this address will be received or<BR>
otherwise recorded by the A.G. Edwards corporate e-mail system and is<BR>
subject to archival, monitoring or review by, and/or disclosure to,<BR>
someone other than the recipient.<BR>
************************************************************************************<BR>
 </FONT></CODE></BODY>
</HTML>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic