Skip to content

Commit 816736b

Browse files
author
Arun Prasaad
committed
Add new example output
1 parent a2c3409 commit 816736b

1 file changed

Lines changed: 30 additions & 1 deletion

File tree

README.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Literate Testing
2+
23
These are examples of how to use naming conventions and grouping to write unit tests in a highly readable manner,
34
resembling a specification so that the reader may gain a deeper understanding of the code being tested.
45

@@ -24,7 +25,35 @@ See below for [test output](#test-output)
2425

2526
[JUnit docs](https://junit.org/junit5/docs/current/user-guide/#writing-tests-display-name-generator) showing these naming conventions
2627

27-
## Test Output
28+
29+
## SimpleStackTest Results
30+
31+
### Given an empty stack
32+
-[it has depth zero](https://github.com/arunbear/literate-testing-java/blob/main/src/test/java/org/example/SimpleStackTest.java#L18-L22)
33+
-[it has no elements](https://github.com/arunbear/literate-testing-java/blob/main/src/test/java/org/example/SimpleStackTest.java#L24-L29)
34+
-[pushing makes it non empty](https://github.com/arunbear/literate-testing-java/blob/main/src/test/java/org/example/SimpleStackTest.java#L31-L36)
35+
-[popping is not allowed](https://github.com/arunbear/literate-testing-java/blob/main/src/test/java/org/example/SimpleStackTest.java#L38-L42)
36+
-[retrieving the top element is not allowed](https://github.com/arunbear/literate-testing-java/blob/main/src/test/java/org/example/SimpleStackTest.java#L44-L48)
37+
38+
### Given any stack
39+
-[pushing increases depth](https://github.com/arunbear/literate-testing-java/blob/main/src/test/java/org/example/SimpleStackTest.java#L54-L59)
40+
-[pushing places new item on top and preserves existing items](https://github.com/arunbear/literate-testing-java/blob/main/src/test/java/org/example/SimpleStackTest.java#L61-L66)
41+
42+
### Given a non empty stack
43+
-[popping returns the top element](https://github.com/arunbear/literate-testing-java/blob/main/src/test/java/org/example/SimpleStackTest.java#L72-L76)
44+
-[popping decreases depth by one](https://github.com/arunbear/literate-testing-java/blob/main/src/test/java/org/example/SimpleStackTest.java#L78-L83)
45+
-[the popped item is removed](https://github.com/arunbear/literate-testing-java/blob/main/src/test/java/org/example/SimpleStackTest.java#L85-L91)
46+
-[popping removes only the top item](https://github.com/arunbear/literate-testing-java/blob/main/src/test/java/org/example/SimpleStackTest.java#L93-L99)
47+
-[items are popped in reverse order](https://github.com/arunbear/literate-testing-java/blob/main/src/test/java/org/example/SimpleStackTest.java#L101-L107)
48+
-[its top item is the last pushed](https://github.com/arunbear/literate-testing-java/blob/main/src/test/java/org/example/SimpleStackTest.java#L109-L114)
49+
-[its list view is unmodifiable](https://github.com/arunbear/literate-testing-java/blob/main/src/test/java/org/example/SimpleStackTest.java#L116-L120)
50+
-[its list view contains items in insertion order](https://github.com/arunbear/literate-testing-java/blob/main/src/test/java/org/example/SimpleStackTest.java#L122-L126)
51+
52+
---
53+
**Test Summary:** 15 tests, 15 succeeded, 0 failed, 0 skipped
54+
**Source:** [SimpleStackTest.java](https://github.com/arunbear/literate-testing-java/blob/main/src/test/java/org/example/SimpleStackTest.java)
55+
56+
## Raw Test Output
2857

2958
```
3059
% ./gradlew clean build

0 commit comments

Comments
 (0)