Skip to content

Commit

Permalink
Fix compiler warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
y0ung3r committed Nov 26, 2023
1 parent 7b717c6 commit 89d0a31
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ import com.intellij.ide.wizard.withVisualPadding
import com.intellij.openapi.wm.ToolWindow
import com.intellij.ui.components.JBCheckBox
import com.intellij.ui.dsl.builder.Align
import com.intellij.ui.dsl.builder.LabelPosition
import com.intellij.ui.dsl.builder.panel
import com.intellij.ui.dsl.gridLayout.HorizontalAlign
import com.intellij.ui.dsl.gridLayout.VerticalAlign
import javax.swing.JComponent

class GitGlobalHooksLocatorWindow(toolWindow: ToolWindow) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,37 +10,18 @@ import org.junit.Test
import java.nio.file.Path

class GetGlobalHooksPathTests {
@Test
fun `Should returns absolute global hooks path using absolute path`() {
// Arrange
val expectedPath = "C:/Users/user/.git/hooks"
val sut = Git(
RespondInterchangeably(
CliResponse(Git.minRequiredVersion.toString()),
CliResponse(expectedPath)
)
)

// Act
val actualPath = sut.getGlobalHooksPath()

// Assert
assertEquals(Path.of(expectedPath), actualPath)
}

@Test
fun `Should returns absolute global hooks path using relative path`() {
// Arrange
val expectedPath = Path.of(
SystemPathUtils.getCurrentDirectoryPath(),
".git",
"hooks"
)
val relativePath = "/.git/hooks"
val expectedPath = Path
.of(relativePath)
.toAbsolutePath()

val sut = Git(
RespondInterchangeably(
CliResponse(Git.minRequiredVersion.toString()),
CliResponse(".git/hooks")
CliResponse(relativePath)
)
)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
package com.github.y0ung3r.gitglobalhookslocator.gitTests

import com.github.y0ung3r.gitglobalhookslocator.git.SemanticVersion
import com.github.y0ung3r.gitglobalhookslocator.git.exceptions.ProvidedSemanticVersionIsInvalidException
import org.junit.Assert.assertEquals
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.Parameterized
import org.junit.runners.Parameterized.Parameters

//@RunWith(Parameterized::class)
Expand Down

0 comments on commit 89d0a31

Please sign in to comment.