diff options
| author | a14m <[email protected]> | 2021-02-10 22:35:11 +0100 |
|---|---|---|
| committer | a14m <[email protected]> | 2021-02-10 22:42:56 +0100 |
| commit | 80776ace98f5d532366e4432beaf20cd96e10a3b (patch) | |
| tree | 6ec5ef3dc99784721a79bbb28a49139845387f53 /CLI/ruby/spec/game_of_life_spec.rb | |
| parent | 9ba51d3f6b2920291deb0793413661b29322b75a (diff) | |
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
Diffstat (limited to 'CLI/ruby/spec/game_of_life_spec.rb')
| -rw-r--r-- | CLI/ruby/spec/game_of_life_spec.rb | 4 |
1 files changed, 2 insertions, 2 deletions
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) |
