-
Notifications
You must be signed in to change notification settings - Fork 587
/
Fake.DotNet.Cli.fs
67 lines (57 loc) · 2.93 KB
/
Fake.DotNet.Cli.fs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
module Fake.DotNet.CliIntegrationTests
open Fake.IO
open Fake.DotNet
open System.IO
open Expecto
open Fake.Core.IntegrationTests.TestHelpers
[<Tests>]
let tests =
testList
"Fake.DotNet.Cli.IntegrationTests"
[ testCase "Make sure dotnet installer works in paths with spaces - #2319"
<| fun _ ->
use d = createTestDir ()
let installerDir = Path.Combine(d.Dir, "Temp Dir")
Directory.create installerDir
let preparedDir = Path.Combine(d.Dir, "Install Dir")
Directory.create preparedDir
let f =
DotNet.install (fun option ->
{ option with
InstallerOptions =
fun o -> { option.InstallerOptions o with CustomDownloadDir = Some installerDir }
ForceInstall = true
CustomInstallDir = Some preparedDir
Channel = DotNet.CliChannel.LTS
Version = DotNet.CliVersion.Latest })
let opts = f (DotNet.Options.Create())
Expect.isTrue (File.Exists opts.DotNetCliPath) "Expected dotnet executable to exist"
Expect.stringStarts opts.DotNetCliPath preparedDir "Expected dotnet cli to start with prepared directory"
testCase "Make sure dotnet installer can install into path with spaces - #2319"
<| fun _ ->
use d = createTestDir ()
let preparedDir = Path.Combine(d.Dir, "Install Dir")
let f =
DotNet.install (fun option ->
{ option with
ForceInstall = true
CustomInstallDir = Some preparedDir
Channel = DotNet.CliChannel.LTS
Version = DotNet.CliVersion.Latest })
let opts = f (DotNet.Options.Create())
Expect.isTrue (File.Exists opts.DotNetCliPath) "Expected dotnet executable to exist"
Expect.stringStarts opts.DotNetCliPath preparedDir "Expected dotnet cli to start with prepared directory"
testCase "Make sure dotnet installer works without spaces - #2319"
<| fun _ ->
use d = createTestDir ()
let preparedDir = Path.Combine(d.Dir, "InstallDir")
let f =
DotNet.install (fun option ->
{ option with
ForceInstall = true
Channel = DotNet.CliChannel.LTS
CustomInstallDir = Some preparedDir
Version = DotNet.CliVersion.Latest })
let opts = f (DotNet.Options.Create())
Expect.isTrue (File.Exists opts.DotNetCliPath) "Expected dotnet executable to exist"
Expect.stringStarts opts.DotNetCliPath preparedDir "Expected dotnet cli to start with prepared directory" ]