Skip to content

Commit

Permalink
Move close to teardown also for test_run_ruby
Browse files Browse the repository at this point in the history
  • Loading branch information
tompng committed Oct 23, 2024
1 parent 2060325 commit 266b9b8
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions test/yamatanooroti/test_run_ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@
require 'tmpdir'

class Yamatanooroti::TestRunRuby < Yamatanooroti::TestCase
def teardown
close
end

def test_winsize
start_terminal(5, 30, ['ruby', '-rio/console', '-e', 'puts(IO.console.winsize.inspect)'])
assert_screen(<<~EOC)
[5, 30]
EOC
close
end

def test_wait_for_startup_message
Expand All @@ -19,14 +22,12 @@ def test_wait_for_startup_message
prompt>hello
HELLO
EOC
close
end

def test_move_cursor_and_render
start_terminal(5, 30, ['ruby', '-rio/console', '-e', 'STDOUT.puts(?A);STDOUT.goto(2,2);STDOUT.puts(?B)'])
assert_screen(['A', '', ' B', '', ''])
assert_equal(['A', '', ' B', '', ''], result)
close
end

def test_meta_key
Expand All @@ -38,7 +39,6 @@ def test_meta_key
assert_screen(<<~EOC)
>>>aaa bbb ccc
EOC
close
ensure
get_out_from_tmpdir
end
Expand All @@ -50,7 +50,6 @@ def test_assert_screen_takes_a_message_when_failed
bbb
EOC
end
close
end

private
Expand Down

0 comments on commit 266b9b8

Please sign in to comment.