Examples by example
An “example” (or example method ) is a unary method that produces an example object .
In Glamorous Toolkit, examples serve as test methods and can contain assertions.
An example is always annotated with a <gtExample> pragma. For example, BrTextEditorSelecterExamples>>#select_moveOneRight_at_6
defines an example method that produces a text editor, moves a cursor, simulates a selection, and eventually asserts that it answers the selection.
An example can be based on one or more other examples. In the case above, the example relies on another example from BrTextEditorOperatorExamples>>#editorOnMultilineText
. It does that by calling self editorOnMultilineText.