From a73f28243e1f782ff84cd1e787c4c22bd7350ab6 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 13 Nov 2012 18:06:30 +0200 Subject: Move ansi library in project core --- spec/lib/ansi2html_spec.rb | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 spec/lib/ansi2html_spec.rb (limited to 'spec/lib') 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 == 'Hello' + end + + it "prints simply yellow" do + Ansi2html::convert("\e[33mHello\e[0m").should == 'Hello' + end + + it "prints simply blue" do + Ansi2html::convert("\e[34mHello\e[0m").should == 'Hello' + end + + it "prints simply grey" do + Ansi2html::convert("\e[90mHello\e[0m").should == 'Hello' + end + + it "white bold boys have more fun" do + Ansi2html::convert("\e[37m\e[1mHello\e[0m\e[0m").should == 'Hello' + end +end -- cgit v1.2.1