Sha256: e0b2fb1723552069d8b1920d25d0da93f4b7fdd44603c98761f12ad2eabb2961

Contents?: true

Size: 389 Bytes

Versions: 5

Compression:

Stored size: 389 Bytes

Contents

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

  it "spins default frames" do
    spinner = TTY::Spinner.new(output: output)
    5.times do |n|
      spinner.spin
      spinner.reset if n == 2
    end
    output.rewind
    expect(output.read).to eq([
      "\e[1G|",
      "\e[1G/",
      "\e[1G-",
      "\e[1G|",
      "\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/reset_spec.rb
planter-cli-3.0.5 lib/tty-spinner/spec/unit/reset_spec.rb
planter-cli-3.0.4 lib/tty-spinner/spec/unit/reset_spec.rb
planter-cli-3.0.3 lib/tty-spinner/spec/unit/reset_spec.rb
planter-cli-3.0.2 lib/tty-spinner/spec/unit/reset_spec.rb