From 80776ace98f5d532366e4432beaf20cd96e10a3b Mon Sep 17 00:00:00 2001 From: a14m Date: Wed, 10 Feb 2021 22:35:11 +0100 Subject: Better and more performant ruby rendering in alternative terminal Ref: https://github.com/ruby/ruby/blob/ruby_2_7/lib/irb/easter-egg.rb#L112-L131 Ref: https://stackoverflow.com/questions/11023929/using-the-alternate-screen-in-a-bash-script Ref: https://superuser.com/questions/122911/what-commands-can-i-use-to-reset-and-clear-my-terminal --- CLI/ruby/spec/game_of_life_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'CLI/ruby/spec') diff --git a/CLI/ruby/spec/game_of_life_spec.rb b/CLI/ruby/spec/game_of_life_spec.rb index 89a0c87..a0013a6 100644 --- a/CLI/ruby/spec/game_of_life_spec.rb +++ b/CLI/ruby/spec/game_of_life_spec.rb @@ -181,8 +181,8 @@ RSpec.describe GameOfLife do it "renders the game of life presentation" do stub_const("BANNER", "") stub_const("DELAY", 100.0) - expect_any_instance_of(Kernel).to receive(:puts).with("\33c\e[3J") - expect_any_instance_of(Kernel).to receive(:puts).twice + expect_any_instance_of(Kernel).to receive(:print).with("\e[?1049h\e[H") + expect_any_instance_of(Kernel).to receive(:print).twice expect(universe).to receive(:to_s) expect_any_instance_of(Kernel).to receive(:sleep) -- cgit v1.2.3