code: def test_rule_align():
      console = Console(
          width=16,
          file=io.StringIO(),
          legacy_windows=False,
          _environ={},
      )
      console.rule("foo")
      console.rule("foo", align="left")
      console.rule("foo", align="center")
      console.rule("foo", align="right")
      console.rule()
      result = console.file.getvalue()
      print(repr(result))
      expected = "───── foo ──────\nfoo ────────────\n───── foo ──────\n──────────── foo\n────────────────\n"
      assert result == expected
  
file_path: rich/tests/test_rule.py
imports: import io
  import pytest
  from rich.console import Console
  from rich.rule import Rule
  from rich.text import Text
label_desc: Use image node_id 3 for calling a global function with example usage: test_rule_align() without return types