From 0f262293d6dd127d2b04b9f5fa0d82a146a370e7 Mon Sep 17 00:00:00 2001 From: Alastair Pitts Date: Fri, 25 Oct 2024 16:37:08 +1100 Subject: [PATCH] Normalize line endings for Linux --- .../KubernetesFixtures/ManifestDataMaskerTests.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/Calamari.Tests/KubernetesFixtures/ManifestDataMaskerTests.cs b/source/Calamari.Tests/KubernetesFixtures/ManifestDataMaskerTests.cs index ec15ff4cf..6f9c5eb80 100644 --- a/source/Calamari.Tests/KubernetesFixtures/ManifestDataMaskerTests.cs +++ b/source/Calamari.Tests/KubernetesFixtures/ManifestDataMaskerTests.cs @@ -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; @@ -25,6 +26,8 @@ public void MaskSensitiveData_ShouldMaskExpectedTasks(string sourceYaml, string node = (YamlMappingNode)doc.RootNode; } + expectedYaml = expectedYaml.ReplaceLineEndings(); + //Act ManifestDataMasker.MaskSensitiveData(node); @@ -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); }