1 write to MockHome
Aspire.Acquisition.Tests (1)
Scripts\Common\TestEnvironment.cs (1)
31MockHome = Path.Combine(TempDirectory, "home");
159 references to MockHome
Aspire.Acquisition.Tests (159)
Scripts\Common\ScriptFunctionCommand.cs (4)
42WithEnvironmentVariable("HOME", _testEnvironment.MockHome); 43WithEnvironmentVariable("USERPROFILE", _testEnvironment.MockHome); 47WithEnvironmentVariable("XDG_CONFIG_HOME", Path.Combine(_testEnvironment.MockHome, ".config")); 48WithEnvironmentVariable("ZDOTDIR", _testEnvironment.MockHome);
Scripts\Common\ScriptToolCommand.cs (4)
34WithEnvironmentVariable("HOME", _testEnvironment.MockHome); 35WithEnvironmentVariable("USERPROFILE", _testEnvironment.MockHome); 39WithEnvironmentVariable("XDG_CONFIG_HOME", Path.Combine(_testEnvironment.MockHome, ".config")); 40WithEnvironmentVariable("ZDOTDIR", _testEnvironment.MockHome);
Scripts\Common\TestEnvironment.cs (1)
33Directory.CreateDirectory(MockHome);
Scripts\CompletionScriptTests.cs (76)
20var cli = CreateFakeCli(env.MockHome); 21var profile = Path.Combine(env.MockHome, "profile.ps1"); 22var blockedDirectory = Path.GetDirectoryName(CompletionPath(env.MockHome, cli, dogfood))!; 29Set-Variable HOME '{{Quote(env.MockHome)}}' -Force 41Assert.False(File.Exists(Path.Combine(env.MockHome, "called"))); 110var home = Path.Combine(env.MockHome, "it's $home ` [test]"); 166var cli = CreateFakeCli(outsideHome ? Path.Combine(env.TempDirectory, "custom install") : env.MockHome); 167var profile = Path.Combine(env.MockHome, "profile.ps1"); 168var completion = CompletionPath(env.MockHome, cli, dogfood || outsideHome); 175Set-Variable HOME '{{Quote(env.MockHome)}}' -Force 192Assert.False(File.Exists(Path.Combine(env.MockHome, "called"))); 210Set-Variable HOME '{{Quote(env.MockHome)}}' -Force 221Assert.True(File.Exists(CompletionPath(env.MockHome, cli, dogfood: false))); 234var profile = Path.Combine(env.MockHome, "profile.ps1"); 236var completion = CompletionPath(env.MockHome, cli, dogfood: true); 241Set-Variable HOME '{{Quote(env.MockHome)}}' -Force 257Assert.False(Directory.Exists(Path.Combine(env.MockHome, ".aspire"))); 274var profile = Path.Combine(env.MockHome, "profile.ps1"); 281var completion = CompletionPath(env.MockHome, cli, dogfood: true); 287Set-Variable HOME '{{Quote(env.MockHome)}}' -Force 311Assert.False(File.Exists(Path.Combine(env.MockHome, "called"))); 324var profile = Path.Combine(env.MockHome, "profile.ps1"); 329Set-Variable HOME '{{Quote(env.MockHome)}}' -Force 354var cli = CreateFakeCli(env.MockHome); 355var profile = Path.Combine(env.MockHome, "profile.ps1"); 356var completion = CompletionPath(env.MockHome, cli, dogfood); 363Set-Variable HOME '{{Quote(env.MockHome)}}' -Force 377Assert.False(File.Exists(Path.Combine(env.MockHome, "called"))); 389var cli = CreateFakeCli(env.MockHome); 390var profile = Path.Combine(env.MockHome, "profile.ps1"); 395Set-Variable HOME '{{Quote(env.MockHome)}}' -Force 406Assert.True(File.Exists(CompletionPath(env.MockHome, cli, dogfood: true))); 416var cli = CreateFakeCli(env.MockHome); 417var profile = Path.Combine(env.MockHome, "profile.ps1"); 423Set-Variable HOME '{{Quote(env.MockHome)}}' -Force 434Assert.True(File.Exists(CompletionPath(env.MockHome, cli, dogfood: false))); 444var cli = CreateFakeCli(env.MockHome); 445var profile = Path.Combine(env.MockHome, "profile.ps1"); 446var completion = CompletionPath(env.MockHome, cli, dogfood); 453Set-Variable HOME '{{Quote(env.MockHome)}}' -Force 465Assert.False(File.Exists(Path.Combine(env.MockHome, "called"))); 499var cli = CreateFakeCli(env.MockHome); 500var bashrc = Path.Combine(env.MockHome, ".bashrc"); 504File.CreateSymbolicLink(Path.Combine(env.MockHome, ".bash_profile"), outside); 522var cli = CreateFakeCli(env.MockHome); 529var profiles = new[] { Path.Combine(env.MockHome, ".bashrc"), Path.Combine(env.MockHome, ".bash_profile") }; 629var home = Path.Combine(env.MockHome, "it's $home ` [test]"); 697var cli = CreateFakeCli(outsideHome ? Path.Combine(env.TempDirectory, "custom install") : env.MockHome); 698var completion = Path.Combine(dogfood || outsideHome ? Path.GetDirectoryName(cli)! : Path.Combine(env.MockHome, ".aspire"), "completions", "aspire.bash"); 701var profile = Path.Combine(env.MockHome, ".bashrc"); 724Assert.False(File.Exists(Path.Combine(env.MockHome, "called"))); 740File.CreateSymbolicLink(Path.Combine(env.MockHome, ".zshrc"), outside); 747ZDOTDIR='{{Quote(symlink ? env.MockHome : installRoot)}}' 756Assert.True(File.Exists(Path.Combine(env.MockHome, ".aspire", "completions", "aspire.zsh"))); 776"zsh" => Path.Combine(env.MockHome, ".zshrc"), 777"fish" => Path.Combine(env.MockHome, ".config", "fish", "conf.d", "aspire-completions.fish"), 778_ => Path.Combine(env.MockHome, ".bashrc") 803Assert.False(Directory.Exists(Path.Combine(env.MockHome, ".aspire"))); 804Assert.False(File.Exists(Path.Combine(env.MockHome, ".bash_profile"))); 823var profile = Path.Combine(env.MockHome, ".bashrc"); 866Assert.False(File.Exists(Path.Combine(env.MockHome, "called"))); 878var profile = Path.Combine(env.MockHome, ".bashrc"); 906var cli = CreateFakeCli(env.MockHome); 907var profile = Path.Combine(env.MockHome, loginProfile); 927Assert.True(File.Exists(Path.Combine(env.MockHome, ".bashrc"))); 934var cli = CreateFakeCli(env.MockHome); 935File.WriteAllText(Path.Combine(env.MockHome, ".bashrc"), "export ASPIRE_TEST_BASHRC_LOADED=true\n"); 959var cli = CreateFakeCli(env.MockHome); 960var profile = Path.Combine(env.MockHome, ".bashrc"); 976Assert.True(File.Exists(Path.Combine(env.MockHome, "completions", "aspire.bash"))); 977Assert.False(File.Exists(Path.Combine(env.MockHome, ".bash_profile"))); 985var cli = CreateFakeCli(env.MockHome); 986var profile = Path.Combine(env.MockHome, ".bashrc"); 1003Assert.False(File.Exists(Path.Combine(env.MockHome, ".bash_profile"))); 1004Assert.True(File.Exists(Path.Combine(env.MockHome, ".aspire", "completions", "aspire.bash")));
Scripts\PipedInstallTests.cs (20)
40cmd.WithEnvironmentVariable("HOME", env.MockHome); 41cmd.WithEnvironmentVariable("USERPROFILE", env.MockHome); 63cmd.WithEnvironmentVariable("HOME", env.MockHome); 64cmd.WithEnvironmentVariable("USERPROFILE", env.MockHome); 81cmd.WithEnvironmentVariable("HOME", env.MockHome); 82cmd.WithEnvironmentVariable("USERPROFILE", env.MockHome); 101cmd.WithEnvironmentVariable("HOME", env.MockHome); 102cmd.WithEnvironmentVariable("USERPROFILE", env.MockHome); 131cmd.WithEnvironmentVariable("HOME", env.MockHome); 132cmd.WithEnvironmentVariable("USERPROFILE", env.MockHome); 153cmd.WithEnvironmentVariable("HOME", env.MockHome); 154cmd.WithEnvironmentVariable("USERPROFILE", env.MockHome); 178cmd.WithEnvironmentVariable("HOME", env.MockHome); 179cmd.WithEnvironmentVariable("USERPROFILE", env.MockHome); 202cmd.WithEnvironmentVariable("HOME", env.MockHome); 203cmd.WithEnvironmentVariable("USERPROFILE", env.MockHome); 221cmd.WithEnvironmentVariable("HOME", env.MockHome); 222cmd.WithEnvironmentVariable("USERPROFILE", env.MockHome); 242cmd.WithEnvironmentVariable("HOME", env.MockHome); 243cmd.WithEnvironmentVariable("USERPROFILE", env.MockHome);
Scripts\PRScriptFunctionTests.cs (2)
372var configFile = Path.Combine(env.MockHome, ".zshrc"); 375var newPath = Path.Combine(env.MockHome, ".aspire", "bin");
Scripts\PRScriptPowerShellTests.cs (13)
83Assert.False(Directory.Exists(Path.Combine(env.MockHome, ".aspire"))); 468var expectedBinaryPath = Path.Combine(env.MockHome, ".aspire", "dogfood", "pr-99999", "bin", binaryName); 488var sidecarPath = Path.Combine(env.MockHome, ".aspire", "dogfood", "pr-99999", "bin", ".aspire-install.json"); 515var binDir = Path.Combine(env.MockHome, ".aspire", "dogfood", "pr-99999", "bin"); 540Assert.DoesNotContain(Path.Combine(env.MockHome, ".aspire", "dogfood", "pr-99999", "bin"), hintLine); 585var sidecarPath = Path.Combine(env.MockHome, ".aspire", "dogfood", "pr-99999", "bin", ".aspire-install.json"); 601var globalConfig = Path.Combine(env.MockHome, ".aspire", "aspire.config.json"); 634var binSidecar = Path.Combine(env.MockHome, ".aspire", "bin", ".aspire-install.json"); 638var aspireRoot = Path.Combine(env.MockHome, ".aspire"); 657AssertNoDogfoodInstall(env.MockHome); 671AssertNoDogfoodInstall(env.MockHome); 692AssertNoDogfoodInstall(env.MockHome); 711AssertNoDogfoodInstall(env.MockHome);
Scripts\PRScriptShellTests.cs (13)
74Assert.Empty(Directory.GetFileSystemEntries(env.MockHome)); 543var expectedBinaryPath = Path.Combine(env.MockHome, ".aspire", "dogfood", "pr-99999", "bin", "aspire"); 545var scriptRouteBin = Path.Combine(env.MockHome, ".aspire", "bin", "aspire"); 565var sidecarPath = Path.Combine(env.MockHome, ".aspire", "dogfood", "pr-99999", "bin", ".aspire-install.json"); 590Assert.DoesNotContain(env.MockHome, hintLine); 650var sidecarPath = Path.Combine(env.MockHome, ".aspire", "dogfood", "pr-99999", "bin", ".aspire-install.json"); 666var globalConfig = Path.Combine(env.MockHome, ".aspire", "aspire.config.json"); 701var binSidecar = Path.Combine(env.MockHome, ".aspire", "bin", ".aspire-install.json"); 705var aspireRoot = Path.Combine(env.MockHome, ".aspire"); 724AssertNoDogfoodInstall(env.MockHome); 741var sidecarPath = Path.Combine(env.MockHome, ".aspire", "dogfood", "pr-99999999999", "bin", ".aspire-install.json"); 769AssertNoDogfoodInstall(env.MockHome); 787AssertNoDogfoodInstall(env.MockHome);
Scripts\PRScriptToolModeTests.cs (6)
442var prHive = Path.Combine(env.MockHome, ".aspire", "hives", "pr-5678", "packages"); 506var sidecarPath = Path.Combine(env.MockHome, ".aspire", "dogfood", "pr-12345", "bin", ".aspire-install.json"); 510var prHive = Path.Combine(env.MockHome, ".aspire", "hives", "pr-12345", "packages"); 1018var prHive = Path.Combine(env.MockHome, ".aspire", "hives", "pr-5678", "packages"); 1050var sidecarPath = Path.Combine(env.MockHome, ".aspire", "dogfood", "pr-12345", "bin", ".aspire-install.json"); 1054var prHive = Path.Combine(env.MockHome, ".aspire", "hives", "pr-12345", "packages");
Scripts\ReleaseScriptFunctionTests.cs (10)
510var installPath = Path.Combine(env.MockHome, ".aspire", "bin"); 513File.WriteAllText(Path.Combine(env.MockHome, ".bashrc"), "# existing config\n"); 525var bashrcContent = File.ReadAllText(Path.Combine(env.MockHome, ".bashrc")); 534var installPath = Path.Combine(env.MockHome, ".aspire", "bin"); 537File.WriteAllText(Path.Combine(env.MockHome, ".zshrc"), "# existing config\n"); 549var zshrcContent = File.ReadAllText(Path.Combine(env.MockHome, ".zshrc")); 558var installPath = Path.Combine(env.MockHome, ".aspire", "bin"); 563Path.Combine(env.MockHome, ".bashrc"), 576var bashrcContent = File.ReadAllText(Path.Combine(env.MockHome, ".bashrc")); 585var installPath = Path.Combine(env.MockHome, ".aspire", "bin");
Scripts\ReleaseScriptPowerShellTests.cs (5)
46Assert.False(Directory.Exists(Path.Combine(env.MockHome, ".aspire"))); 377var globalConfig = Path.Combine(env.MockHome, ".aspire", "aspire.config.json"); 399var configPath = Path.Combine(env.MockHome, ".aspire", "aspire.config.json"); 421var sidecarPath = Path.Combine(env.MockHome, ".aspire", "bin", ".aspire-install.json"); 439var sidecarPath = Path.Combine(env.MockHome, ".aspire", "bin", ".aspire-install.json");
Scripts\ReleaseScriptShellTests.cs (5)
44Assert.Empty(Directory.GetFileSystemEntries(env.MockHome)); 311var globalConfig = Path.Combine(env.MockHome, ".aspire", "aspire.config.json"); 333var configPath = Path.Combine(env.MockHome, ".aspire", "aspire.config.json"); 355var sidecarPath = Path.Combine(env.MockHome, ".aspire", "bin", ".aspire-install.json"); 375var sidecarPath = Path.Combine(env.MockHome, ".aspire", "bin", ".aspire-install.json");