Skip to content
This repository has been archived by the owner on Aug 5, 2024. It is now read-only.

Commit

Permalink
[maintenance] tests are even greener (#326)
Browse files Browse the repository at this point in the history
  • Loading branch information
abrams27 authored Jan 27, 2023
1 parent 6b5206a commit a18959b
Showing 1 changed file with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,29 @@ import org.junit.jupiter.api.Nested
import org.junit.jupiter.api.Test
import kotlin.io.path.Path


class BazelPathSpecMapperTest {

@Nested
@DisplayName("fun map(projectView): Try<BazelPathSpec> tests")
inner class MapTest {

// TODO https://youtrack.jetbrains.com/issue/BAZEL-58 + framework to test envs
@Disabled("for now we don't have a framework to change classpath, i'll fix it later")
@Test
fun `should return failure if it isn't possible to deduct bazel path from PATH and bazel path is null`() {
// given
val projectView = ProjectView.Builder(bazelPath = null).build().get()
// TODO https://youtrack.jetbrains.com/issue/BAZEL-58 + framework to test envs
@Disabled("for now we don't have a framework to change classpath, i'll fix it later")
@Test
fun `should return failure if it isn't possible to deduct bazel path from PATH and bazel path is null`() {
// given
val projectView = ProjectView.Builder(bazelPath = null).build().get()

// when
val bazelPathSpecTry = BazelPathSpecMapper.map(projectView)
// when
val bazelPathSpecTry = BazelPathSpecMapper.map(projectView)

// then
bazelPathSpecTry.isFailure shouldBe true
bazelPathSpecTry.cause::cause shouldBe ProjectViewToExecutionContextEntityMapperException::class
bazelPathSpecTry.cause.message shouldBe "Mapping project view into 'bazel path' failed! Could not find bazel on your PATH"
}
// then
bazelPathSpecTry.isFailure shouldBe true
bazelPathSpecTry.cause::cause shouldBe ProjectViewToExecutionContextEntityMapperException::class
bazelPathSpecTry.cause.message shouldBe "Mapping project view into 'bazel path' failed! Could not find bazel on your PATH"
}

@Disabled("for now we don't have a framework to change classpath, i'll fix it later")
@Test
fun `should return success with deducted bazel path from PATH if bazel path is null`() {
// given
Expand Down

0 comments on commit a18959b

Please sign in to comment.