Sha256: ed6025e4990d81f6abd91e6181ae66015d432818da5fabcf2a346254e53890be

Contents?: true

Size: 623 Bytes

Versions: 2

Compression:

Stored size: 623 Bytes

Contents

require 'test_helper'

class TestProgressBar < Test::Unit::TestCase
  include Collimator

  def teardown
    $stdout = STDOUT
  end

  def test_spinner
    spin_time = 1
    out = capture_output do
      Spinner.spin
      sleep spin_time
      Spinner.stop
    end

    length_should_be = (spin_time / 0.1) * 2
    s = out.string.clone
    assert_equal length_should_be, s.length

    spin_time = 0.2
    out = capture_output do
      Spinner.spin
      sleep spin_time
      Spinner.stop
    end

    length_should_be = (spin_time / 0.1) * 2
    s = out.string.clone
    assert_equal length_should_be, s.length
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
collimator-0.0.2 test/spinner_test.rb
collimator-0.0.1 test/spinner_test.rb