~/talk

Structure Unit Testing with Spek

Talkat droidcon SF 2019 · 2019-11-18..11-19· [testing]
links:none on file
slides:none on file

Spek is a Kotlin testing DSL that runs on the JUnit 5 engine and supports Android with a dedicated IDE plugin and Jacoco coverage. It provides memoized delegate fixtures that create new instances per test by default and a configurable caching mode: test or eachGroup to share instances across scopes. Two styles exist, spec (describe/context/it) and Gherkin like (given/when/then), with caveats: discovery runs group code, given/when count as tests, and failing Gherkin blocks stop nested execution. It works but requires careful fixture placement.

AI-written summary · about

  1. 0:00Introduction and speaker background
  2. 1:16Talk overview and audience check
  3. 2:34Problems with traditional JUnit tests
  4. 5:42Introduction to Spek framework
  5. 6:45Setting up Spek in a project
  6. 7:27Basic test structure in Spek
  7. 9:57Test execution phases in Spek
  8. 10:40Fixtures and test setup
  9. 12:48Property isolation with memoized delegates
  10. 15:33Writing parameterized tests
  11. 16:14Running Spek tests in IDEs
  12. 17:17Specification style in Spek
  13. 18:46Example test case walkthrough
  14. 20:31Mocking and test behavior setup
  15. 21:34Skipping tests in Spek
  16. 23:03Gherkin style in Spek
  17. 24:06Gherkin example and output
  18. 25:54Gherkin style limitations
  19. 28:43Pros and cons of Spek styles
  20. 30:31Best practices for using Spek
  21. 30:51Resources and closing
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.