aboutsummaryrefslogtreecommitdiffstats
path: root/lib/minitest/README.txt
diff options
context:
space:
mode:
authorryan <ryan@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-05-09 04:09:25 +0000
committerryan <ryan@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-05-09 04:09:25 +0000
commita213c2ed9c84f0f64f0664e820227034d078f9f9 (patch)
treedbc503f2118fdb51f0c45ebf36ead1b799286468 /lib/minitest/README.txt
parent2dece928e085d25e8326455b9c0f508a2d70d02d (diff)
downloadruby-a213c2ed9c84f0f64f0664e820227034d078f9f9.tar.gz
Imported minitest 3.0.0 (r7435) w/ fixes for rubygems. 10955 tests, 2253343 assertions, 1 failures, 1 errors, 28 skips minus drb tests on x86_64-darwin11.3.0 and reviewed by drbrain
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35601 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/minitest/README.txt')
-rw-r--r--lib/minitest/README.txt18
1 files changed, 15 insertions, 3 deletions
diff --git a/lib/minitest/README.txt b/lib/minitest/README.txt
index 8c33c0aa52..9029354921 100644
--- a/lib/minitest/README.txt
+++ b/lib/minitest/README.txt
@@ -33,8 +33,8 @@ algorithms in a repeatable manner. Now you can assert that your newb
co-worker doesn't replace your linear algorithm with an exponential
one!
-minitest/mock by Steven Baker, is a beautifully tiny mock object
-framework.
+minitest/mock by Steven Baker, is a beautifully tiny mock (and stub)
+object framework.
minitest/pride shows pride in testing and adds coloring to your test
output. I guess it is an example of how to write IO pipes too. :P
@@ -54,7 +54,7 @@ discovery.
* minitest/autorun - the easy and explicit way to run all your tests.
* minitest/unit - a very fast, simple, and clean test system.
* minitest/spec - a very fast, simple, and clean spec system.
-* minitest/mock - a simple and clean mock system.
+* minitest/mock - a simple and clean mock/stub system.
* minitest/benchmark - an awesome way to assert your algorithm's performance.
* minitest/pride - show your pride in testing!
* Incredibly small and fast runner, but no bells and whistles.
@@ -194,6 +194,18 @@ Output is tab-delimited to make it easy to paste into a spreadsheet.
end
end
+=== Stubs
+
+ def test_stale_eh
+ obj_under_test = Something.new
+
+ refute obj_under_test.stale?
+
+ Time.stub :now, Time.at(0) do # stub goes away once the block is done
+ assert obj_under_test.stale?
+ end
+ end
+
=== Customizable Test Runner Types:
MiniTest::Unit.runner=(runner) provides an easy way of creating custom