Skip to content

Commit

Permalink
test: clear output
Browse files Browse the repository at this point in the history
Signed-off-by: Joke de Buhr <joke@xckk.de>
  • Loading branch information
joke committed Mar 12, 2024
1 parent 7b00e6c commit 61aa319
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,4 @@ class ServiceTest extends Specification {
globalLogs ==~ /(?s).*Hello Universe.*/
localLogs ==~ /(?s).*Hello Universe.*/
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,21 @@ class TypedLogs extends Specification {
globalLogs.lines ==~ /(?s).*Hello Universe.*/
localLogs.lines==~ /(?s).*Hello Universe.*/
}

def 'clear logger'() {
when:
localLogger.logSomething('Hello Test')

then:
localLogs ==~ /(?s).*Hello Test.*/

and:
when:
localLogs.clear()
localLogger.logSomething('Hello again Test')

then:
!(localLogs ==~ /(?s).*Hello Test.*/)
localLogs ==~ /(?s).*Hello again Test.*/
}
}

0 comments on commit 61aa319

Please sign in to comment.