diff options
| author | Yusuke Endoh <mame@ruby-lang.org> | 2025-12-25 00:08:38 +0900 |
|---|---|---|
| committer | Yusuke Endoh <mame@ruby-lang.org> | 2025-12-26 14:20:00 +0900 |
| commit | 704ac72fb67bc431c7d77d0d0aaa7e5b5331b096 (patch) | |
| tree | cf4bed1c058e1748424643ce51be6e8791a2749f /test | |
| parent | b01fd2d8c3195cc9936f6be6f89df0de12394a28 (diff) | |
Clarify the intent of the test for "ruby -h" to fit in 80x25
Diffstat (limited to 'test')
| -rw-r--r-- | test/ruby/test_rubyoptions.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/test/ruby/test_rubyoptions.rb b/test/ruby/test_rubyoptions.rb index 735d2681fb..cd2dd5d3ff 100644 --- a/test/ruby/test_rubyoptions.rb +++ b/test/ruby/test_rubyoptions.rb @@ -47,10 +47,15 @@ class TestRubyOptions < Test::Unit::TestCase assert_in_out_err([], "", [], []) end + # This constant enforces the traditional 80x25 terminal size standard + TRADITIONAL_TERM_COLS = 80 # DO NOT MODIFY! + TRADITIONAL_TERM_ROWS = 25 # DO NOT MODIFY! + def test_usage + # This test checks if the output of `ruby -h` fits in 80x25 assert_in_out_err(%w(-h)) do |r, e| - assert_operator(r.size, :<=, 25) - longer = r[1..-1].select {|x| x.size >= 80} + assert_operator(r.size, :<=, TRADITIONAL_TERM_ROWS) + longer = r[1..-1].select {|x| x.size >= TRADITIONAL_TERM_COLS} assert_equal([], longer) assert_equal([], e) end |
