Sha256: 08d01ee95d64826fd03255446165cc3561d6d75c32334a056dfbb428ae038691

Contents?: true

Size: 903 Bytes

Versions: 3

Compression:

Stored size: 903 Bytes

Contents

require_relative '../helper'
require 'termistat'

class Included
  include Termistat
end

class TestTermistat < MiniTest::Unit::TestCase
  def setup
    Termistat.config = nil
    @included = Included.new
  end

  def test_status_bar_method
    assert @included.respond_to?(:status_bar)
  end

  def test_ncurses_initialization
    # @included.status_bar "hello"
  end

  def test_default_configuration
    assert_equal :top_right, Termistat.config.position
  end

  def test_configuration
    Termistat.config do
      position :top_left
      align    :center
    end

    assert_equal :top_left, Termistat.config.position
  end

  def test_text_alignment
    assert_equal "foo       ", Termistat.formatted_message("foo", :left, 10)
    assert_equal "       foo", Termistat.formatted_message("foo", :right, 10)
    assert_equal "   foo    ", Termistat.formatted_message("foo", :center, 10)
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
termistat-0.0.3 test/units/test_termistat.rb
termistat-0.0.2 test/units/test_termistat.rb
termistat-0.0.1 test/units/test_termistat.rb