code: def test_rule_error():
      console = Console(
          width=16,
          file=io.StringIO(),
          legacy_windows=False,
          _environ={},
      )
      with pytest.raises(ValueError):
          console.rule("foo", align="foo")
  
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 2 for calling a global function with example usage: test_rule_error() without return types