Sha256: 8481a6a7a291c8217d7c3f14c4e4c5bac5d8beaa72e8fab7b4f97eabca156bcc

Contents?: true

Size: 397 Bytes

Versions: 9

Compression:

Stored size: 397 Bytes

Contents

# coding: utf-8

require 'spec_helper'

RSpec.describe TTY::ProgressBar, 'current' do
  let(:output) { StringIO.new('', 'w+') }

  it "displays current value" do
    progress = TTY::ProgressBar.new("|:current|", output: output, total: 10)
    3.times { progress.advance }
    output.rewind
    expect(output.read).to eq([
      "\e[1G|1|",
      "\e[1G|2|",
      "\e[1G|3|"
    ].join)
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
tty-progressbar-0.8.0 spec/unit/formatter/current_spec.rb
tty-progressbar-0.7.0 spec/unit/formatter/current_spec.rb
tty-progressbar-0.6.0 spec/unit/formatter/current_spec.rb
tty-progressbar-0.5.1 spec/unit/formatter/current_spec.rb
tty-progressbar-0.5.0 spec/unit/formatter/current_spec.rb
tty-progressbar-0.4.0 spec/unit/formatter/current_spec.rb
tty-progressbar-0.3.0 spec/unit/formatter/current_spec.rb
tty-progressbar-0.2.0 spec/unit/current_formatter_spec.rb
tty-progressbar-0.1.0 spec/unit/current_formatter_spec.rb