File: case_ansicode.rb

package info (click to toggle)
ruby-ansi 1.4.3-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 364 kB
  • ctags: 298
  • sloc: ruby: 1,827; makefile: 4
file content (31 lines) | stat: -rw-r--r-- 522 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
require 'test_helper'
require 'ansi/code'

testcase ANSI::Code do

  unit :red do
    str = ANSI::Code.red
    out = "\e[31m"
    out.assert == str
  end

  omit :red => "with block notation" do
    str = ANSI::Code.red { "Hello" }
    out = "\e[31mHello\e[0m"
    out.assert == str
  end

  unit :blue do
    str = ANSI::Code.blue
    out = "\e[34m"
    out.assert == str
  end

  omit :blue => "with block notation" do
    str = ANSI::Code.blue { "World" }
    out = "\e[34mWorld\e[0m"
    out.assert == str
  end

end