code: def test_characters():
      console = Console(
          width=16,
          file=io.StringIO(),
          force_terminal=True,
          color_system=None,
          legacy_windows=False,
          _environ={},
      )
      console.rule(characters="+*")
      console.rule("foo", characters="+*")
      console.print(Rule(characters=".,"))
      expected = "+*+*+*+*+*+*+*+*\n"
      expected += "+*+*+ foo +*+*+*\n"
      expected += ".,.,.,.,.,.,.,.,\n"
      assert console.file.getvalue() == 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 9 for calling a global function with example usage: test_characters() without return types