Class: TTYtest::Terminal
- Inherits:
-
Object
- Object
- TTYtest::Terminal
- Extended by:
- Forwardable
- Defined in:
- lib/ttytest/terminal.rb
Instance Attribute Summary collapse
-
#max_wait_time ⇒ Integer
the maximum amount of time (in seconds) to retry assertions before failing.
Instance Method Summary collapse
-
#capture ⇒ Capture
Capture the current state of the terminal.
- #cursor_hidden? ⇒ true, false
- #cursor_visible? ⇒ true, false
- #cursor_x ⇒ Integer
- #cursor_y ⇒ Integer
- #height ⇒ Integer
-
#initialize(driver_terminal, max_wait_time: nil) ⇒ Terminal
constructor
private
A new instance of Terminal.
- #row(row) ⇒ String
- #rows ⇒ Array<String>
-
#send_keys(*keys) ⇒ Object
Simulate typing keys into the terminal.
- #width ⇒ Integer
Constructor Details
#initialize(driver_terminal, max_wait_time: nil) ⇒ Terminal
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Terminal.
14 15 16 17 |
# File 'lib/ttytest/terminal.rb', line 14 def initialize(driver_terminal, max_wait_time: nil) @driver_terminal = driver_terminal @max_wait_time = max_wait_time || TTYtest.default_max_wait_time end |
Instance Attribute Details
#max_wait_time ⇒ Integer
the maximum amount of time (in seconds) to retry assertions before failing.
7 8 9 |
# File 'lib/ttytest/terminal.rb', line 7 def max_wait_time @max_wait_time end |
Instance Method Details
#capture ⇒ Capture
Capture the current state of the terminal
25 |
# File 'lib/ttytest/terminal.rb', line 25 def_delegators :@driver_terminal, :send_keys, :capture |
#cursor_hidden? ⇒ true, false
51 |
# File 'lib/ttytest/terminal.rb', line 51 def_delegators :capture, :rows, :row, :width, :height, :cursor_x, :cursor_y, :cursor_visible?, :cursor_hidden? |
#cursor_visible? ⇒ true, false
51 |
# File 'lib/ttytest/terminal.rb', line 51 def_delegators :capture, :rows, :row, :width, :height, :cursor_x, :cursor_y, :cursor_visible?, :cursor_hidden? |
#cursor_x ⇒ Integer
51 |
# File 'lib/ttytest/terminal.rb', line 51 def_delegators :capture, :rows, :row, :width, :height, :cursor_x, :cursor_y, :cursor_visible?, :cursor_hidden? |
#cursor_y ⇒ Integer
51 |
# File 'lib/ttytest/terminal.rb', line 51 def_delegators :capture, :rows, :row, :width, :height, :cursor_x, :cursor_y, :cursor_visible?, :cursor_hidden? |
#height ⇒ Integer
51 |
# File 'lib/ttytest/terminal.rb', line 51 def_delegators :capture, :rows, :row, :width, :height, :cursor_x, :cursor_y, :cursor_visible?, :cursor_hidden? |
#row(row) ⇒ String
51 |
# File 'lib/ttytest/terminal.rb', line 51 def_delegators :capture, :rows, :row, :width, :height, :cursor_x, :cursor_y, :cursor_visible?, :cursor_hidden? |
#rows ⇒ Array<String>
51 |
# File 'lib/ttytest/terminal.rb', line 51 def_delegators :capture, :rows, :row, :width, :height, :cursor_x, :cursor_y, :cursor_visible?, :cursor_hidden? |
#send_keys(*keys) ⇒ Object
Simulate typing keys into the terminal
25 |
# File 'lib/ttytest/terminal.rb', line 25 def_delegators :@driver_terminal, :send_keys, :capture |
#width ⇒ Integer
51 |
# File 'lib/ttytest/terminal.rb', line 51 def_delegators :capture, :rows, :row, :width, :height, :cursor_x, :cursor_y, :cursor_visible?, :cursor_hidden? |