Skip to content

Commit

Permalink
Add titles to example steps and assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Kim Dung-Pham committed Apr 17, 2020
1 parent 30cd15c commit 89e353c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ func test_iCanSeeTheStars() {

---

<img width=600 src="Resources/test-output.png" alt="Example Output in the Report navigator">
<img width=800 src="Resources/test-output.png" alt="Example Output in the Report navigator">
Binary file modified Resources/test-output.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions Tests/RorschachTests/StepsAndAssertions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,21 @@ public class UniverseContext {

class ILearnABitMore: Step<UniverseContext> {

override var title: String {
"I learn a bit more"
}

override func execute(in context: inout UniverseContext) {
print("I am learning...")
}
}

class IBuildARocket: Step<UniverseContext> {

override var title: String {
"I build a rocket"
}

override func execute(in context: inout UniverseContext) {
context.numberOfStars = 7
print("I am building a rocket that flies far enough to see 7 stars...")
Expand All @@ -31,6 +39,10 @@ class IBuildARocket: Step<UniverseContext> {

class ILaunchARocket: Step<UniverseContext> {

override var title: String {
"I launch a rocket"
}

override func execute(in context: inout UniverseContext) {
print("I launch a rocket")
}
Expand All @@ -40,6 +52,10 @@ class ILaunchARocket: Step<UniverseContext> {

class ICanSeeTheStars: Assertion<UniverseContext> {

override var title: String {
"I assert that I can see the stars"
}

override func assert(in context: UniverseContext) {
print("I can see \(context.numberOfStars) stars!")
}
Expand Down

0 comments on commit 89e353c

Please sign in to comment.