File: case_progressbar.rb

package info (click to toggle)
ruby-ansi 1.5.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 404 kB
  • sloc: ruby: 1,880; makefile: 5
file content (21 lines) | stat: -rw-r--r-- 382 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
require 'test_helper'
require 'stringio'
require 'ansi/progressbar'

testcase ANSI::Progressbar do

  method :initialize do
    test do
      stio = StringIO.new
      pbar = ANSI::Progressbar.new("Test Bar", 10, stio) do |b|
        b.style(:title => [:red], :bar=>[:blue])
      end
      10.times do |i|
        sleep 0.1
        pbar.inc
      end
      true
    end
  end

end