Skip to content

Commit

Permalink
DisableScrubUserProfileTests
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCropp committed Apr 3, 2024
1 parent d0277ed commit a0939b8
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 2 deletions.
1 change: 0 additions & 1 deletion src/StaticSettingsTests/DisableDirScrubbingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
{
public DisableDirScrubbingTests()
{
VerifierSettings.DontScrubUserProfile();
VerifierSettings.DontScrubSolutionDirectory();
VerifierSettings.DontScrubProjectDirectory();
var solutionDirectory = AttributeReader.GetSolutionDirectory();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
C:\Users\simon
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
 C:\Users\simon
16 changes: 16 additions & 0 deletions src/StaticSettingsTests/DisableScrubUserProfileTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
public class DisableScrubUserProfileTests :
BaseTest
{
string profileDir = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);

public DisableScrubUserProfileTests() =>
VerifierSettings.DontScrubUserProfile();

[Fact(Skip = "explicit")]
public Task Simple() =>
Verify(profileDir);

[Fact(Skip = "explicit")]
public Task Wrapped() =>
Verify($" {profileDir} ");
}
3 changes: 2 additions & 1 deletion src/Verify/Serialization/Scrubbers/ApplyScrubbers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ public static void UseAssembly(string? solutionDir, string projectDir)
replacements[altTempPath + altDirSeparator] = "{TempPath}";
replacements[altTempPath] = "{TempPath}";

if (VerifierSettings.scrubUserProfile && RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
if (VerifierSettings.scrubUserProfile &&
RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
var profileDir = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
if (!string.IsNullOrWhiteSpace(profileDir))
Expand Down

0 comments on commit a0939b8

Please sign in to comment.