Skip to content

Commit

Permalink
Fix spec
Browse files Browse the repository at this point in the history
  • Loading branch information
gruffins committed Sep 26, 2023
1 parent 6c1252a commit 82192e2
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/kotlinc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 14 additions & 10 deletions birch/src/test/java/com/gruffins/birch/LoggerTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,20 @@ class LoggerTest {
agent.console = true
logger.level = Level.TRACE

val block = spyk({ "test" })

logger.log(Level.TRACE, { "test" }, block)
logger.log(Level.DEBUG, { "test" }, block)
logger.log(Level.INFO, { "test" }, block)
logger.log(Level.WARN, { "test" }, block)
logger.log(Level.ERROR, { "test" }, block)
logger.log(Level.NONE, { "test" }, block)

verify(exactly = 5) { block.invoke() }
var count = 0
val callback = {
count += 1
""
}

logger.log(Level.TRACE, { "test" }, callback)
logger.log(Level.DEBUG, { "test" }, callback)
logger.log(Level.INFO, { "test" }, callback)
logger.log(Level.WARN, { "test" }, callback)
logger.log(Level.ERROR, { "test" }, callback)
logger.log(Level.NONE, { "test" }, callback)

assert(count == 5)
}

@Test
Expand Down

0 comments on commit 82192e2

Please sign in to comment.