This guide explains how to test your RatatuiRuby applications using the provided RatatuiRuby::TestHelper.
You need to verify that your application looks and behaves correctly. Manually checking every character on a terminal screen is tedious. Dealing with race conditions and complex state management in tests creates friction.
The TestHelper module solves this. It provides a headless "test terminal" to capture output and a suite of robust assertions to verify state.
Use it to write fast, deterministic tests for your TUI applications.
First, require the test helper in your test file or test_helper.rb:
require "ratatui_ruby/test_helper"
require "minitest/autorun" # or your preferred test frameworkThen, include the module in your test class:
class MyApplicationTest < Minitest::Test
include RatatuiRuby::TestHelper
# ...
endBecause this gem is in pre-release, it lacks documentation. Please check the source files and automated tests.