specification • Most of the lines start with a special keyword • Feature, Scenario, Given, When , Then, And • Keywords are translated to multiple languages
word # The first example has two steps Scenario: Maker starts a game When the Maker starts a game Then the Maker waits for a Breaker to join # The second example has three steps Scenario: Breaker joins a game Given the Maker has started a game with the word "silky" When the Breaker joins the Maker's game Then the Breaker must guess a word with 5 characters
regarding nesting • Default caching mode EACH_SCOPE -> test are not isolated ->if one test fails, its over • No build in mechanism for skipping • Given/When acts as a test in output and counts as a test
to read -> understand -> review • Reusability made easy (memoized) • Write parametrised tests as normal Kotlin code • Not so many options as jUnit 5 to fine tune • Specification vs Gherkin • Can exist alongside existing jUnit tests -> give it a shot
is your friend • never interact with property outside of before/after..{…} • one assertion per test( it{…},Then{…}, And{…} ) • use test only for assertions