class
Opal::Terminal::MockDriver
- Opal::Terminal::MockDriver
- Opal::Terminal::Driver
- Reference
- Object
Overview
In-memory mock terminal driver for headless automated testing.
Defined in:
opal/terminal/mock.crConstructors
Instance Method Summary
- #alt_screen? : Bool
-
#clear_output : Nil
Clears the recorded output buffer
- #cursor_visible? : Bool
- #disable_mouse : Nil
- #enable_mouse : Nil
- #enter_alternate_screen : Nil
- #event_queue : Array(KeyEvent | MouseEvent)
- #event_queue=(event_queue : Array(KeyEvent | MouseEvent))
- #exit_alternate_screen : Nil
- #flush : Nil
- #height : Int32
- #height=(height : Int32)
- #hide_cursor : Nil
- #in_raw_mode? : Bool
-
#inject_key(name : String, char : Char | Nil = nil, ctrl : Bool = false, alt : Bool = false, shift : Bool = false) : self
Injects a key event into the mock input stream
-
#inject_mouse(x : Int32, y : Int32, button : MouseButton, action : MouseAction) : self
Injects a mouse event
- #mouse_enabled? : Bool
-
#output : String
Returns the full recorded output string
- #output_io : IO::Memory
- #raw_mode(&)
- #read_event : KeyEvent | MouseEvent | Nil
- #show_cursor : Nil
- #size : Tuple(Int32, Int32)
-
#stripped_output : String
Returns the output with all ANSI escape sequences removed
- #width : Int32
- #width=(width : Int32)
- #write(str : String) : Nil
Instance methods inherited from class Opal::Terminal::Driver
clear : Nil
clear,
disable_mouse : Nil
disable_mouse,
enable_mouse : Nil
enable_mouse,
enter_alternate_screen : Nil
enter_alternate_screen,
exit_alternate_screen : Nil
exit_alternate_screen,
flush : Nil
flush,
hide_cursor : Nil
hide_cursor,
move_to(row : Int32, col : Int32) : Nil
move_to,
raw_mode(&)
raw_mode,
read_event : KeyEvent | MouseEvent | Nil
read_event,
show_cursor : Nil
show_cursor,
size : Tuple(Int32, Int32)
size,
write(str : String) : Nil
write
Constructor Detail
Instance Method Detail
def inject_key(name : String, char : Char | Nil = nil, ctrl : Bool = false, alt : Bool = false, shift : Bool = false) : self
#
Injects a key event into the mock input stream
Injects a mouse event