Sha256: a1654e178aef9a4a505540422642cbede1fcb4299464cd46346e537c7d142887

Contents?: true

Size: 750 Bytes

Versions: 8

Compression:

Stored size: 750 Bytes

Contents

#!/usr/bin/env ruby
# coding: utf-8
require 'rubygems'
require 'tools'
require 'minitest/autorun'

class ToolsModuleTest < Minitest::Test

  def test_cmdapi_dislay
    ToolsDisplay.instance
    old_stdout = $stdout
    captured_stdio = StringIO.new('', 'w')
    $stdout = captured_stdio
    ToolsDisplay.show "TEXTO VERDE", :green
    $stdout = old_stdout
    assert_equal "\e[0;32;49mTEXTO VERDE\n\e[0m", captured_stdio.string
  end

  def test_cmdapi_dislay_sameline
    ToolsDisplay.instance
    old_stdout = $stdout
    captured_stdio = StringIO.new('', 'w')
    $stdout = captured_stdio
    ToolsDisplay.show "TEXTO SAMELINE", :sameline
    $stdout = old_stdout
    assert_equal "\e[0;39;49mTEXTO SAMELINE\e[0m", captured_stdio.string
  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
tools-0.4.4 test/minitest/minit-display.rb
tools-0.4.3 test/minitest/minit-display.rb
tools-0.4.2 test/minitest/minit-display.rb
tools-0.4.1 test/minitest/minit-display.rb
tools-0.3.9 test/minitest/minit-display.rb
tools-0.0.7 test/minitest/minit-display.rb
tools-0.0.6 test/minitest/minit-display.rb
tools-0.0.5 test/minitest/minit-display.rb