Skip to content

Instantly share code, notes, and snippets.

@dariathecracker
Last active June 4, 2020 12:11
Show Gist options
  • Save dariathecracker/c5ce542f934b5aa8e7a3c2daf9cfb238 to your computer and use it in GitHub Desktop.
Save dariathecracker/c5ce542f934b5aa8e7a3c2daf9cfb238 to your computer and use it in GitHub Desktop.
Tic-Tac-Toe Game
package ioleo.tictactoe
import zio.test.{assert, suite, testM, DefaultRunnableSpec}
import zio.test.environment.TestConsole
import zio.test.Assertion.equalTo
object TicTacToeSpec extends DefaultRunnableSpec(
suite("TicTacToe")(
testM("prints to console") {
for {
test <- TestConsole.makeTest(TestConsole.DefaultData)
_ <- TicTacToe.program.provide(new TestConsole {
val console = test
})
out <- test.output
} yield assert(out, equalTo(Vector("TicTacToe game!\n")))
}
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment