Hi,
I want to announce my testsupp.rb library to the public. The lib is
not tested enough to be bullet-proof, but seems simple enough to be
relative error free (means, it works for me ;-).
But however, if you find any error, or if you have any improvement
proposal, please let me know:
mailto: c.hintze / gmx.net
I have put the files `testsupp.rb' and `testsupp.README' into the
`incoming' incoming directory of the FTP server right now. But it will
take its time until matz has moved them into the `contrib' directory.
Then you will find them there.
Following I have included the README, which is only the commented part
of the source.
Happy testing,
\cle
########
# testsupp.rb by C.Hintze 11.08.1999 (mailto: c.hintze / gmx.net)
#
# $Id: testsupp.rb,v 1.6 1999/08/11 17:54:16 cle Exp $
# $Release Version: 0.1$
#
# The methods of that module are derived directly from the ones contained
# in the file `sample/test.rb' contained in the Ruby delivery. I don't know
# who has originally written them, but I assume it was Yukihiro Matsumoto
# <matz / netlab.co.jp>. I have done not much more, than to put them together
# into this module, and modify theirs output. But, however, if you find an
# error within, it is certain that it was me, who has introduced it ;-)
#
# The methods are thought to help you to write very simple scripts supporting
# you to test a class, module or extension.
#
# Example of usage without categories:
#
# require "testsupp"; include TestSupp
#
# start_tests
#
# s1 = "hello world" # Create a string
# s2 = String.new s1 # Create another one, with same contents as s1
# ok s1 == s2 # Both should be equal
# s1[1] = ?a # Change "hello" -> "hallo" in s1
# ok s1 != s2 # Now they should be different :-)
#
# end_tests
#
# Example with categories:
#
# require "testsupp"; include TestSupp
#
# start_tests
#
# check "String concatenation"
# s1 = "hello"
# s2 = "world"
# ok((s1+" "+s2) == "hello world")
# ok((s1<<" "<<s2) == "hello world")
# ok s1 == "hello world"
#
# check "String slicing"
# ok s1[1..2] == "el"
# ok s1[-8..-7] == "lo"
#
# check "String replacement"
# s1 = "hello"
# s2 = "world"
# s3 = s1
# s1[1] = ?a
# s2[1..-1] = "elt"
# ok s1 == s3
# ok (s1+" "+s2) == "hallo welt"
#
# end_tests
#
########
# LICENSE:
# SAME LICENSE AS RUBY.
#############################################################################
# I really hate it to say, but nevertheless here comes... #
# #
# THE WARRANTY: #
# I DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL #
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL I BE #
# LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES #
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN #
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF #
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #
#############################################################################