mirror of
				https://github.com/nsnail/spectre.console.git
				synced 2025-11-04 02:25:28 +08:00 
			
		
		
		
	Add option to show separator between table rows (#1304)
* Add option to show separator between table rows * Panels should show header if borders are not shown Closes #835
This commit is contained in:
		@@ -1 +1 @@
 | 
			
		||||
 Hello World 
 | 
			
		||||
 Hello World 
 | 
			
		||||
 
 | 
			
		||||
@@ -0,0 +1,2 @@
 | 
			
		||||
  Greeting   
 | 
			
		||||
 Hello World 
 | 
			
		||||
@@ -0,0 +1,7 @@
 | 
			
		||||
┌────────┬────────┬───────┐
 | 
			
		||||
│ Foo    │ Bar    │ Baz   │
 | 
			
		||||
├────────┼────────┼───────┤
 | 
			
		||||
│ Qux    │ Corgi  │ Waldo │
 | 
			
		||||
├────────┼────────┼───────┤
 | 
			
		||||
│ Grault │ Garply │ Fred  │
 | 
			
		||||
└────────┴────────┴───────┘
 | 
			
		||||
@@ -23,6 +23,22 @@ public sealed class BoxBorderTests
 | 
			
		||||
        [Fact]
 | 
			
		||||
        [Expectation("NoBorder")]
 | 
			
		||||
        public Task Should_Render_As_Expected()
 | 
			
		||||
        {
 | 
			
		||||
            // Given
 | 
			
		||||
            var console = new TestConsole();
 | 
			
		||||
            var panel = Fixture.GetPanel().NoBorder();
 | 
			
		||||
            panel.Header = null;
 | 
			
		||||
 | 
			
		||||
            // When
 | 
			
		||||
            console.Write(panel);
 | 
			
		||||
 | 
			
		||||
            // Then
 | 
			
		||||
            return Verifier.Verify(console.Output);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        [Fact]
 | 
			
		||||
        [Expectation("NoBorder_With_Header")]
 | 
			
		||||
        public Task Should_Render_NoBorder_With_Header_As_Expected()
 | 
			
		||||
        {
 | 
			
		||||
            // Given
 | 
			
		||||
            var console = new TestConsole();
 | 
			
		||||
 
 | 
			
		||||
@@ -142,6 +142,25 @@ public sealed class TableTests
 | 
			
		||||
        return Verifier.Verify(console.Output);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    [Fact]
 | 
			
		||||
    [Expectation("Render_Row_Separators")]
 | 
			
		||||
    public Task Should_Render_Table_With_Row_Separators_Correctly()
 | 
			
		||||
    {
 | 
			
		||||
        // Given
 | 
			
		||||
        var console = new TestConsole();
 | 
			
		||||
        var table = new Table();
 | 
			
		||||
        table.ShowRowSeparators();
 | 
			
		||||
        table.AddColumns("Foo", "Bar", "Baz");
 | 
			
		||||
        table.AddRow("Qux", "Corgi", "Waldo");
 | 
			
		||||
        table.AddRow("Grault", "Garply", "Fred");
 | 
			
		||||
 | 
			
		||||
        // When
 | 
			
		||||
        console.Write(table);
 | 
			
		||||
 | 
			
		||||
        // Then
 | 
			
		||||
        return Verifier.Verify(console.Output);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    [Fact]
 | 
			
		||||
    [Expectation("Render_EA_Character")]
 | 
			
		||||
    public Task Should_Render_Table_With_EA_Character_Correctly()
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user