/lib/rex/ui/text/color.rb.ut.rb

https://bitbucket.org/technopunk2099/metasploit-framework · Ruby · 19 lines · 11 code · 6 blank · 2 comment · 0 complexity · 5e280a7aa32c342ae26a114d2fa37198 MD5 · raw file

  1. #!/usr/bin/env ruby
  2. # -*- coding: binary -*-
  3. $:.unshift(File.join(File.dirname(__FILE__), '..', '..', '..'))
  4. require 'test/unit'
  5. require 'rex/ui/text/color'
  6. class Rex::Ui::Text::Color::UnitTest < Test::Unit::TestCase
  7. def test_color
  8. color = Rex::Ui::Text::Color.new.ansi('bold', 'red')
  9. color += 'hey sup'
  10. color += Rex::Ui::Text::Color.new.ansi('clear')
  11. assert_equal("\e[1;31mhey sup\e[0m", color)
  12. end
  13. end