Help:Pickle/Glossary

Glossary for spec tests is a list of core terms and concepts used in spec tests.

Terms and concepts
After marks functions to be run after, , and. It use a single queue so all functions will be run in correct sequence. An alias for this is teardown. AfterAll marks functions similar to, except it is run once. Strictly speaking this function is not necessary as code can be added inline. It use a single queue so all functions will be run in correct sequence. It use the same queue as after so it will be run at the correct time in the first test. At later invocations it will not be run. Around is alternate to that is only run if the test throws an. If an exception is thrown, and there is an around function registered, then no after function will be run. Assertions are tests that focuses on the actual code, and assertions about that code, and their falsy states. In depth article on Assertion (software development). Before marks functions to be run before, , and. It use a single queue so all functions will be run in correct sequence. An alias for this is setup. BeforeAll marks functions similar to, except it is run once. Strictly speaking this function is not necessary as code can be added inline. It use a single queue so all functions will be run in correct sequence. It use the same queue as before so it will be run at the correct time in the first test. At later invocations it will not be run. Carp is a that adds a message to stack without exiting the test, printing the callers name and its arguments. Cluck is a like, but also prints a stack trace starting one level up. Croak is a like, but also stops the running test (the user provided anonymous function). Because it throws an exception it will always trigger a stack trace. Confess is a like, and is an alias for. Describe marks functions used as examples. See for details. Context marks functions used as examples. See for details. Examples are the levels in the describe, context, and it ladder. The name and level are a bit arbitrary as they all have the same function. The context is often left out, and only describe and it are used. Exceptions are error states reported from within the code. They will be catched by the test framework. In depth article on Exception handling. Expectations are tests that focuses on the provided objects and examples, and their truthy states. It marks functions used as examples. See for details. Mock is a simulated object that act as a strictly controlled replacement for a real object. A mock is a type of. In depth article on Mock object. Overfitting happen when there are to tight couplings between the test and source code. Usually happen when tests use spies to verify internal datastructures in source code. Return is the outermost zero-level that encapsulates the test results and returns them in a formatted fashion. Spies are functions that can be registered on other functions, or injected into code to report or alter internal states. Spying on public calls made before the module is available to the testing regime will not be possible. Stub is simulated code, usually a function in this context, that act as a strictly controlled replacement for some real code. A stub is a type of. In depth article on Test stub. Subject is the object under test. It can be explicitly set or set as part of the. It is passed on to. Test doubles are code replacing pieces of code that isn't tested, and should return only known values. In depth article on Test double.