Module: TTYtest::CursorAssertions
- Included in:
- Assertions
- Defined in:
- lib/ttytest/assertions/cursor_assertions.rb
Overview
Cursor Assertions for ttytest2.
Instance Method Summary collapse
-
#assert_cursor_hidden ⇒ Object
Asserts the cursor is currently hidden.
-
#assert_cursor_position(x, y) ⇒ Object
Asserts that the cursor is in the expected position.
-
#assert_cursor_visible ⇒ Object
Asserts the cursor is currently visible.
Instance Method Details
#assert_cursor_hidden ⇒ Object
Asserts the cursor is currently hidden
30 31 32 33 34 |
# File 'lib/ttytest/assertions/cursor_assertions.rb', line 30 def assert_cursor_hidden return if cursor_hidden? raise MatchError, "expected cursor to be hidden was visible\nEntire screen:\n#{self}" end |
#assert_cursor_position(x, y) ⇒ Object
Asserts that the cursor is in the expected position
10 11 12 13 14 15 16 17 18 |
# File 'lib/ttytest/assertions/cursor_assertions.rb', line 10 def assert_cursor_position(x, y) expected = [x, y] actual = [cursor_x, cursor_y] return if actual == expected raise MatchError, "expected cursor to be at #{expected.inspect} but was at #{get_inspection(actual)}\nEntire screen:\n#{self}" end |
#assert_cursor_visible ⇒ Object
Asserts the cursor is currently visible
22 23 24 25 26 |
# File 'lib/ttytest/assertions/cursor_assertions.rb', line 22 def assert_cursor_visible return if cursor_visible? raise MatchError, "expected cursor to be visible was hidden\nEntire screen:\n#{self}" end |