Sha256: de45748a56e70c1dddb0e6e3298c74bceea36aa4589e3296d8d82ee034239b23

Contents?: true

Size: 598 Bytes

Versions: 11

Compression:

Stored size: 598 Bytes

Contents

require 'test/unit'

require File.join(File.dirname(__FILE__), '..', 'lib/cliutils/ext/string_extensions')

# Tests for the String extension methods
class TestStringExtensions < Test::Unit::TestCase
  def test_custom_colors
    assert_output("\e[34mtest\e[0m\n") { puts 'test'.blue }
    assert_output("\e[36mtest\e[0m\n") { puts 'test'.cyan }
    assert_output("\e[32mtest\e[0m\n") { puts 'test'.green }
    assert_output("\e[35mtest\e[0m\n") { puts 'test'.purple }
    assert_output("\e[31mtest\e[0m\n") { puts 'test'.red }
    assert_output("\e[33mtest\e[0m\n") { puts 'test'.yellow }
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
cliutils-1.4.2 test/string_extesions_test.rb
cliutils-1.4.1 test/string_extesions_test.rb
cliutils-1.4.0 test/string_extesions_test.rb
cliutils-1.3.1 test/string_extesions_test.rb
cliutils-1.3.0 test/string_extesions_test.rb
cliutils-1.2.9 test/string_extesions_test.rb
cliutils-1.2.8 test/string_extesions_test.rb
cliutils-1.2.7 test/string_extesions_test.rb
cliutils-1.2.6 test/string_extesions_test.rb
cliutils-1.2.5 test/string_extesions_test.rb
cliutils-1.2.4 test/string_extesions_test.rb