Skip to content

Commit

Permalink
Normalize line endings for Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
APErebus committed Oct 25, 2024
1 parent fd25ac8 commit 0f26229
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.IO;
using System.Linq;
using Calamari.Kubernetes;
using Calamari.Tests.Helpers;
using FluentAssertions;
using NUnit.Framework;
using YamlDotNet.RepresentationModel;
Expand All @@ -25,6 +26,8 @@ public void MaskSensitiveData_ShouldMaskExpectedTasks(string sourceYaml, string
node = (YamlMappingNode)doc.RootNode;
}

expectedYaml = expectedYaml.ReplaceLineEndings();

//Act
ManifestDataMasker.MaskSensitiveData(node);

Expand All @@ -36,7 +39,8 @@ public void MaskSensitiveData_ShouldMaskExpectedTasks(string sourceYaml, string

var outputYaml = writer.ToString()
//The yaml stream adds a document separator (...) to the end of the yaml (even for a single document), so strip it as we don't care for the test assertion
.TrimEnd('\r', '\n', '.');
.TrimEnd('\r', '\n', '.')
.ReplaceLineEndings();

outputYaml.Should().Be(expectedYaml);
}
Expand Down

0 comments on commit 0f26229

Please sign in to comment.