Package com.tngtech.jgiven.base
Class StageBase<SELF extends StageBase<?>>
java.lang.Object
com.tngtech.jgiven.base.StageBase<SELF>
- Type Parameters:
SELF
- the type of the subclass
Useful base class for step definitions as it provides a
self()
method
to create fluent interfaces.
Direct subclasses should provide introduction words (see IntroWord
).
Typically one derives from one of the language-specific step definition classes, which already provide a handful of useful introduction words.
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
StageBase
public StageBase()
-
-
Method Details
-
self
-
$
A step method for creating ad-hoc steps using lambdas.Example Usage
given().$( "Two negative arguments", stage -> { stage.given().argument( -5 ) .and().argument( -6 ); });
- Parameters:
description
- the description of the stepfunction
- the implementation of the step in form of a function where the parameter is the stage the step is executed in- Throws:
Exception
- Since:
- 0.7.1
-
$
A simple helper to provide a descriptionExample Usage
given().$( "a description to improve the report, but is not related to any code that needs to be executed");
); }- Parameters:
description
- the description of the step- Since:
- 0.15.4
-