| 55 | |
| 56 | |
| 57 | def test_rule_in_ratio_table(): |
| 58 | console = Console(width=32, file=io.StringIO(), legacy_windows=False, _environ={}) |
| 59 | table = Table(box=box.ASCII, expand=True, show_header=False) |
| 60 | table.add_column(ratio=1) |
| 61 | table.add_column() |
| 62 | table.add_row("COL1", "COL2") |
| 63 | table.add_row("COL1", Rule(style=None)) |
| 64 | table.add_row("COL1", "COL2") |
| 65 | console.print(table) |
| 66 | expected = dedent( |
| 67 | """\ |
| 68 | +------------------------------+ |
| 69 | | COL1 | COL2 | |
| 70 | | COL1 | ──── | |
| 71 | | COL1 | COL2 | |
| 72 | +------------------------------+ |
| 73 | """ |
| 74 | ) |
| 75 | result = console.file.getvalue() |
| 76 | assert result == expected |