Skip to content

Commit

Permalink
Add fluent interface to test stages
Browse files Browse the repository at this point in the history
Signed-off-by: l-1sqared <[email protected]>
  • Loading branch information
l-1squared committed Feb 9, 2022
1 parent bc0a12b commit 3d2fc1c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ public GivenTestStage an_exception_is_thrown() {
throw new RuntimeException("Some Exception");
}

public void nothing() {
public GivenTestStage nothing() {
return this;
}

public void a_failed_step(boolean fail) {
public GivenTestStage a_failed_step(boolean fail) {
if (fail) {
throw new IllegalArgumentException();
}
return this;
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public WhenTestStage something_happens() {
return self();
}

public void a_step_fails() {
public WhenTestStage a_step_fails() {
throw new AssertionError( "assertion failed in test step" );
}

Expand Down

0 comments on commit 3d2fc1c

Please sign in to comment.