Sha256: 0f3160b446b8065bd4a081f419c858a8167376c3f0aff7ae7ab022f5b01ef398

Contents?: true

Size: 377 Bytes

Versions: 5

Compression:

Stored size: 377 Bytes

Contents

RSpec.describe TTY::Spinner, ":clear" do
  let(:output) { StringIO.new("", "w+") }

  it "clears output when done" do
    spinner = TTY::Spinner.new(clear: true, output: output)
    3.times { spinner.spin }
    spinner.stop("Done!")
    output.rewind
    expect(output.read).to eq([
      "\e[1G|",
      "\e[1G/",
      "\e[1G-",
      "\e[0m\e[2K\e[1G"
    ].join)
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
planter-cli-3.0.7 lib/tty-spinner/spec/unit/clear_spec.rb
planter-cli-3.0.5 lib/tty-spinner/spec/unit/clear_spec.rb
planter-cli-3.0.4 lib/tty-spinner/spec/unit/clear_spec.rb
planter-cli-3.0.3 lib/tty-spinner/spec/unit/clear_spec.rb
planter-cli-3.0.2 lib/tty-spinner/spec/unit/clear_spec.rb