Sha256: 872307ba38275fa7289126e72e8cc8751f01ee3677d341d5548c587272e474a1
Contents?: true
Size: 618 Bytes
Versions: 2
Compression:
Stored size: 618 Bytes
Contents
RSpec.describe TTY::ProgressBar, '#width' do let(:output) { StringIO.new('', 'w+') } it "handles width exceeding terminal width" do progress = TTY::ProgressBar.new "[:bar]" do |config| config.output = output config.total = 5 config.width = 1024 end allow(TTY::Screen).to receive(:width).and_return(20) 5.times { progress.advance } output.rewind expect(output.read).to eq([ "\e[1G[==== ]", "\e[1G[======= ]", "\e[1G[=========== ]", "\e[1G[============== ]", "\e[1G[==================]\n" ].join) end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
tty-progressbar-0.14.0 | spec/unit/width_spec.rb |
tty-progressbar-0.13.0 | spec/unit/width_spec.rb |