This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ioleo.tictactoe | |
import zio.{console, App , ZEnv, ZIO} | |
import zio.console.Console | |
object TicTacToe extends App { | |
val program: ZIO[Console, Nothing, Unit] = | |
console.putStrLn("TicTacToe game!") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ioleo.tictactoe | |
import zio.{console, App , ZEnv, ZIO} | |
import zio.console.Console | |
object TicTacToe extends App { | |
val program: ZIO[Console, Nothing, Unit] = | |
console.putStrLn("TicTacToe game!") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
libraryDependencies += "dev.zio" %% "zio" % "1.0.0-RC16" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
libraryDependencies ++= Seq( | |
"dev.zio" %% "zio-test" % "1.0.0-RC16" % "test", | |
"dev.zio" %% "zio-test-sbt" % "1.0.0-RC16" % "test" | |
), | |
testFrameworks := Seq(new TestFramework("zio.test.sbt.ZTestFramework")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
libraryDependencies ++= Seq( | |
"dev.zio" %% "zio-test" % "1.0.0-RC16" % "test", | |
"dev.zio" %% "zio-test-sbt" % "1.0.0-RC16" % "test" | |
), | |
testFrameworks := Seq(new TestFramework("zio.test.sbt.ZTestFramework")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ioleo.tictactoe.domain | |
sealed trait MenuCommand | |
object MenuCommand { | |
case object NewGame extends MenuCommand | |
case object Resume extends MenuCommand | |
case object Quit extends MenuCommand | |
case object Invalid extends MenuCommand | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ioleo.tictactoe.parser | |
import ioleo.tictactoe.domain.MenuCommand | |
import zio.ZIO | |
import zio.macros.annotation.{accessible, mockable} | |
@accessible(">") | |
@mockable | |
trait MenuCommandParser { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
libraryDependencies ++= Seq( | |
"dev.zio" %% "zio-macros-core" % "0.5.0", | |
"dev.zio" %% "zio-macros-test" % "0.5.0" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ioleo.tictactoe.parser | |
import ioleo.tictactoe.domain.MenuCommand | |
import zio.UIO | |
trait MenuCommandParserLive extends MenuCommandParser { | |
val menuCommandParser = new MenuCommandParser.Service[Any] { | |
def parse(input: String): UIO[MenuCommand] = ??? |
OlderNewer