summaryrefslogtreecommitdiff
path: root/spec/lib
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2012-11-13 18:06:30 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2012-11-13 18:06:39 +0200
commita73f28243e1f782ff84cd1e787c4c22bd7350ab6 (patch)
tree978b83da445de5b1d852e2d93dc3424692c48c5e /spec/lib
parent6a0e60b84308df41b3cee5c7ced39229512bb32a (diff)
downloadgitlab-ci-a73f28243e1f782ff84cd1e787c4c22bd7350ab6.tar.gz
Move ansi library in project core
Diffstat (limited to 'spec/lib')
-rw-r--r--spec/lib/ansi2html_spec.rb27
1 files changed, 27 insertions, 0 deletions
diff --git a/spec/lib/ansi2html_spec.rb b/spec/lib/ansi2html_spec.rb
new file mode 100644
index 0000000..73700c1
--- /dev/null
+++ b/spec/lib/ansi2html_spec.rb
@@ -0,0 +1,27 @@
+require 'spec_helper'
+
+describe Ansi2html do
+ it "prints non-ansi as-is" do
+ Ansi2html::convert("Hello").should == 'Hello'
+ end
+
+ it "prints simply red" do
+ Ansi2html::convert("\e[31mHello\e[0m").should == '<span class="red">Hello</span>'
+ end
+
+ it "prints simply yellow" do
+ Ansi2html::convert("\e[33mHello\e[0m").should == '<span class="yellow">Hello</span>'
+ end
+
+ it "prints simply blue" do
+ Ansi2html::convert("\e[34mHello\e[0m").should == '<span class="blue">Hello</span>'
+ end
+
+ it "prints simply grey" do
+ Ansi2html::convert("\e[90mHello\e[0m").should == '<span class="grey">Hello</span>'
+ end
+
+ it "white bold boys have more fun" do
+ Ansi2html::convert("\e[37m\e[1mHello\e[0m\e[0m").should == '<span class="white"><span class="bold">Hello</span></span>'
+ end
+end