Skip to content

Commit

Permalink
Made the switch to integration tests, some tests are broken
Browse files Browse the repository at this point in the history
  • Loading branch information
ColOfAbRiX committed Nov 8, 2022
1 parent 7aca782 commit bc4cc7e
Show file tree
Hide file tree
Showing 8 changed files with 61 additions and 53 deletions.
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ lazy val figlet4sCore: Project = project
// Figlet4s Effects project
lazy val figlet4sEffects: Project = project
.in(file("figlet4s-effects"))
.dependsOn(figlet4sCore % "compile->compile;test->test")
.dependsOn(figlet4sCore % "compile->compile;test->test;it->it")
.settings(commonScalaSettings)
.configs(IntegrationTest)
.settings(Defaults.itSettings)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
package com.colofabrix.scala.figlet4s.options

import com.colofabrix.scala.figlet4s.core.Figlet4sClient
import com.colofabrix.scala.figlet4s.testutils._
import com.colofabrix.scala.figlet4s.unsafe._
import org.scalatest.flatspec._
import org.scalatest.matchers.should._

class OptionsBuilderSpecs extends AnyFlatSpec with Matchers with Figlet4sMatchers {
class OptionsBuilderSpecs extends AnyFlatSpec with Matchers {

// Text //

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package com.colofabrix.scala.figlet4s.catsio

import cats.effect._
import com.colofabrix.scala.figlet4s.figfont._
import com.colofabrix.scala.figlet4s.StandardTestData._
import com.colofabrix.scala.figlet4s.testutils.Figlet4sMatchers
import org.scalatest.flatspec._
import org.scalatest.matchers.should._

class CatsIOFiglet4sSpecs extends AnyFlatSpec with Matchers with Figlet4sMatchers {

private def run[A](a: IO[A]): A = a.unsafeRunSync()

"Rendering APIs" should "render a default text using the \"standard\" font" in {
val test =
for {
options <- standardBuilder.options
} yield {
val computed = Figlet4s.renderString(standardInput, options)
val expected = FIGure(options.font, standardInput, Vector(standardLines.toSubcolumns))
computed should lookLike(expected)
}

run(test)
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package com.colofabrix.scala.figlet4s.either

import cats.scalatest._
import com.colofabrix.scala.figlet4s.figfont._
import com.colofabrix.scala.figlet4s.StandardTestData._
import com.colofabrix.scala.figlet4s.testutils.Figlet4sMatchers
import org.scalatest.flatspec._
import org.scalatest.matchers.should._

class EitherFiglet4sSpecs extends AnyFlatSpec with Matchers with Figlet4sMatchers with EitherMatchers {

"Rendering APIs" should "render a default text using the \"standard\" font" in {
val computed =
for {
options <- standardBuilder.options
} yield {
val computed = Figlet4s.renderString(standardInput, options)
val expected = FIGure(options.font, standardInput, Vector(standardLines.toSubcolumns))
computed should lookLike(expected)
}

computed should be(right)
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,17 @@ package com.colofabrix.scala.figlet4s.catsio

import cats.effect._
import cats.implicits._
import com.colofabrix.scala.figlet4s.core.Figlet4sClient
import com.colofabrix.scala.figlet4s.errors._
import com.colofabrix.scala.figlet4s.figfont._
import com.colofabrix.scala.figlet4s.StandardTestData._
import com.colofabrix.scala.figlet4s.testutils.Figlet4sMatchers
import com.colofabrix.scala.figlet4s.utils._
import org.scalatest._
import org.scalatest.flatspec._
import org.scalatest.matchers.should._
import scala.concurrent._
import com.colofabrix.scala.figlet4s.core.Figlet4sClient

class CatsIOFiglet4sSpecs extends AnyFlatSpec with Matchers with OptionValues with Figlet4sMatchers {
class CatsIOFiglet4sSpecs extends AnyFlatSpec with Matchers with OptionValues {

private def run[A](a: IO[A]): A = a.unsafeRunSync()

// Rendering //

"Rendering APIs" should "render a default text using the \"standard\" font" in {
val test =
for {
options <- standardBuilder.options
} yield {
val computed = Figlet4s.renderString(standardInput, options)
val expected = FIGure(options.font, standardInput, Vector(standardLines.toSubcolumns))
computed should lookLike(expected)
}

run(test)
}

// Internal fonts //

"Internal Fonts API" should "return the list of internal fonts containing at least the \"standard\" font" in {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,38 +1,15 @@
package com.colofabrix.scala.figlet4s.either

import cats.scalatest._
import cats.effect._
import cats.implicits._
import cats.scalatest._
import com.colofabrix.scala.figlet4s.core.Figlet4sClient
import com.colofabrix.scala.figlet4s.errors._
import com.colofabrix.scala.figlet4s.figfont._
import com.colofabrix.scala.figlet4s.StandardTestData._
import com.colofabrix.scala.figlet4s.testutils.Figlet4sMatchers
import org.scalatest.flatspec._
import org.scalatest.matchers.should._
import scala.concurrent._
import com.colofabrix.scala.figlet4s.core.Figlet4sClient

class EitherFiglet4sSpecs
extends AnyFlatSpec
with Matchers
with Figlet4sMatchers
with EitherMatchers
with EitherValues {

// Rendering //

"Rendering APIs" should "render a default text using the \"standard\" font" in {
val computed =
for {
options <- standardBuilder.options
} yield {
val computed = Figlet4s.renderString(standardInput, options)
val expected = FIGure(options.font, standardInput, Vector(standardLines.toSubcolumns))
computed should lookLike(expected)
}

computed should be(right)
}
class EitherFiglet4sSpecs extends AnyFlatSpec with Matchers with EitherMatchers with EitherValues {

// Internal fonts //

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
package com.colofabrix.java.figlet4s

import com.colofabrix.scala.figlet4s.errors._
import com.colofabrix.scala.figlet4s.testutils._
import org.scalatest.flatspec._
import org.scalatest.matchers.should._
import scala.jdk.CollectionConverters
import scala.util._

class JavaFiglet4sSpecs extends AnyFlatSpec with Matchers with Figlet4sMatchers with OriginalFigletTesting {
class JavaFiglet4sSpecs extends AnyFlatSpec with Matchers {

// Internal fonts //

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import com.colofabrix.scala.figlet4s.testutils._
import org.scalatest.flatspec._
import org.scalatest.matchers.should._

class JavaOptionsBuilderSpecs extends AnyFlatSpec with Matchers with Figlet4sMatchers {
class JavaOptionsBuilderSpecs extends AnyFlatSpec with Matchers {

// Text //

Expand Down

0 comments on commit bc4cc7e

Please sign in to comment.