|
3 | 3 | // See the LICENSE file in the project root for more information |
4 | 4 |
|
5 | 5 | using System.IO.Abstractions.TestingHelpers; |
| 6 | +using System.Runtime.InteropServices; |
6 | 7 | using Elastic.Documentation.Configuration.DocSet; |
7 | 8 | using Elastic.Documentation.Diagnostics; |
8 | 9 | using FluentAssertions; |
@@ -760,22 +761,25 @@ public void LoadAndResolveSetsContextForAllItems() |
760 | 761 | var collector = new DiagnosticsCollector([]); |
761 | 762 | var result = DocumentationSetFile.LoadAndResolve(collector, docsetPath, fileSystem); |
762 | 763 |
|
| 764 | + var docset = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "C:/docs/docset.yml" : "/docs/docset.yml"; |
| 765 | + var toc = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "C:/docs/development/toc.yml" : "/docs/development/toc.yml"; |
| 766 | + |
763 | 767 | // All items from docset.yml should have context = /docs/docset.yml |
764 | 768 | result.TableOfContents.ElementAt(0).Should().BeOfType<IndexFileRef>() |
765 | | - .Which.Context.Should().Be("/docs/docset.yml"); |
| 769 | + .Which.Context.Should().Be(docset); |
766 | 770 |
|
767 | 771 | var guidesFolder = result.TableOfContents.ElementAt(1).Should().BeOfType<FolderRef>().Subject; |
768 | | - guidesFolder.Context.Should().Be("/docs/docset.yml"); |
| 772 | + guidesFolder.Context.Should().Be(docset); |
769 | 773 | guidesFolder.Children.ElementAt(0).Should().BeOfType<FileRef>() |
770 | | - .Which.Context.Should().Be("/docs/docset.yml"); |
| 774 | + .Which.Context.Should().Be(docset); |
771 | 775 |
|
772 | 776 | // The TOC ref itself has context = /docs/docset.yml (where it was referenced) |
773 | 777 | var developmentToc = result.TableOfContents.ElementAt(2).Should().BeOfType<IsolatedTableOfContentsRef>().Subject; |
774 | | - developmentToc.Context.Should().Be("/docs/docset.yml"); |
| 778 | + developmentToc.Context.Should().Be(docset); |
775 | 779 |
|
776 | 780 | // But children of the TOC ref should have context = /docs/development/toc.yml (where they were defined) |
777 | 781 | developmentToc.Children.ElementAt(0).Should().BeOfType<FileRef>() |
778 | | - .Which.Context.Should().Be("/docs/development/toc.yml"); |
| 782 | + .Which.Context.Should().Be(toc); |
779 | 783 | } |
780 | 784 |
|
781 | 785 | [Fact] |
|
0 commit comments