File: 01_test_double.md

package info (click to toggle)
ruby-rr 3.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 1,416 kB
  • sloc: ruby: 11,404; makefile: 7
file content (16 lines) | stat: -rw-r--r-- 442 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# What is a test double?

A test double is a generalization of something that replaces a real object to
make it easier to test another object. It's like a stunt double for tests. The
following are test doubles:

* Mocks
* Stubs
* Fakes
* Spies
* Proxies

*Learn more: <http://xunitpatterns.com/Test%20Double.html>*

Currently RR implements mocks, stubs, proxies, and spies. Fakes usually require
custom code, so it is beyond the scope of RR.