/lib/rex/ui/text/color.rb.ut.rb
Ruby | 19 lines | 11 code | 6 blank | 2 comment | 0 complexity | 5e280a7aa32c342ae26a114d2fa37198 MD5 | raw file
Possible License(s): BSD-3-Clause, Apache-2.0, LGPL-2.1, GPL-2.0, MIT
- #!/usr/bin/env ruby
- # -*- coding: binary -*-
- $:.unshift(File.join(File.dirname(__FILE__), '..', '..', '..'))
- require 'test/unit'
- require 'rex/ui/text/color'
- class Rex::Ui::Text::Color::UnitTest < Test::Unit::TestCase
- def test_color
- color = Rex::Ui::Text::Color.new.ansi('bold', 'red')
- color += 'hey sup'
- color += Rex::Ui::Text::Color.new.ansi('clear')
- assert_equal("\e[1;31mhey sup\e[0m", color)
- end
- end