summaryrefslogtreecommitdiffstats
path: root/sample/testunit/adder.rb
diff options
context:
space:
mode:
authorntalbott <ntalbott@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-09-19 02:48:46 +0000
committerntalbott <ntalbott@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-09-19 02:48:46 +0000
commitba51a267716363f1a69632f040ab01da0bbde78e (patch)
tree715b07f7eccd87ad19acb59d51494d85b759fb66 /sample/testunit/adder.rb
parent9fb55fa783bf276e3eebaf04d99ef77902d50e0e (diff)
downloadruby-ba51a267716363f1a69632f040ab01da0bbde78e.tar.gz
ruby-ba51a267716363f1a69632f040ab01da0bbde78e.tar.xz
ruby-ba51a267716363f1a69632f040ab01da0bbde78e.zip
* test/testunit/*: Added.
* lib/test/unit.rb: Documentation update. * lib/test/unit/ui/console/testrunner.rb (TestRunner#initialize): Ditto. * lib/test/unit.rb: Factored out an ObjectSpace collector. * lib/test/unit/collector/objectspace.rb: Ditto. * sample/testunit/*: Added. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4576 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'sample/testunit/adder.rb')
-rw-r--r--sample/testunit/adder.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/sample/testunit/adder.rb b/sample/testunit/adder.rb
new file mode 100644
index 000000000..aa5c88cc7
--- /dev/null
+++ b/sample/testunit/adder.rb
@@ -0,0 +1,13 @@
+# Author:: Nathaniel Talbott.
+# Copyright:: Copyright (c) 2000-2002 Nathaniel Talbott. All rights reserved.
+# License:: Ruby license.
+
+class Adder
+ def initialize(number)
+ @number = number
+ end
+ def add(number)
+ return @number + number
+ end
+end
+