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

Commit

Permalink
Add .exe extension for tests on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
blindpirate committed Feb 25, 2017
1 parent 0a50f09 commit bca32be
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ class DefaultGoBinaryManagerTest {
}

private turnOnMockGo() {
IOUtils.write(resource, 'go/bin/go', '')
IOUtils.write(resource, "go/bin/go${Os.getHostOs().exeExtension()}", '')
environmentVariables.set('PATH', new File(resource, 'go/bin').absolutePath)
Process process = mock(Process)
when(processUtilsDelegate.run([new File(resource, 'go/bin/go').absolutePath, 'version'], null, null)).thenReturn(process)
when(processUtilsDelegate.run([new File(resource, "go/bin/go${Os.getHostOs().exeExtension()}").absolutePath, 'version'], null, null)).thenReturn(process)
when(processUtilsDelegate.getResult(process)).thenReturn(processResult)
when(processResult.getStdout()).thenReturn('go version go1.7.1 darwin/amd64')
}
Expand Down Expand Up @@ -110,7 +110,7 @@ class DefaultGoBinaryManagerTest {
// given
turnOnMockGo()
// then
assert manager.getBinaryPath() == resource.toPath().resolve('go/bin/go')
assert manager.getBinaryPath() == resource.toPath().resolve("go/bin/go${Os.getHostOs().exeExtension()}")
assert manager.getGoVersion() == '1.7.1'
assert manager.getGoroot() == resource.toPath().resolve('go')
}
Expand All @@ -121,7 +121,7 @@ class DefaultGoBinaryManagerTest {
turnOnMockGo()
when(setting.getGoVersion()).thenReturn('1.7.1')
// then
assert manager.getBinaryPath() == resource.toPath().resolve('go/bin/go')
assert manager.getBinaryPath() == resource.toPath().resolve("go/bin/go${Os.getHostOs().exeExtension()}")
assert manager.getGoVersion() == '1.7.1'
assert manager.getGoroot() == resource.toPath().resolve('go')
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ class RenameVendorTaskTest extends TaskTest {


IOUtils.mkdir(resource, 'vendor')
println(resource.list())
task.renameVendor()
}
}

0 comments on commit bca32be

Please sign in to comment.