Sha256: ccce4f91516a23f08ca71331056869f428403931eac7cda23c9d5f85819d4a1b
Contents?: true
Size: 734 Bytes
Versions: 8
Compression:
Stored size: 734 Bytes
Contents
# coding: utf-8 require 'spec_helper' RSpec.describe TTY::ProgressBar::Pipeline, '.decorate' do subject(:pipeline) { described_class.new } it "decorates tokenized string with pipeline formatters" do pipeline.use TTY::ProgressBar::CurrentFormatter pipeline.use TTY::ProgressBar::TotalFormatter progress_bar = double(current: '3', total: '10') tokenized = "[:current/:total]" expect(pipeline.decorate(progress_bar, tokenized)).to eq("[3/10]") end it "enumerates pipeline formatters" do pipeline.use TTY::ProgressBar::CurrentFormatter pipeline.use TTY::ProgressBar::TotalFormatter yielded = [] pipeline.each { |formatter| yielded << formatter } expect(yielded.size).to eq(2) end end
Version data entries
8 entries across 8 versions & 1 rubygems