https://github.com/jekyll/jekyll
Raw File
Tip revision: 281f75182e63998d1fb823aee4f9562aa1f6fded authored by Parker Moore on 16 January 2016, 00:26:08 UTC
Release :gem: 3.1.0.pre.rc1
Tip revision: 281f751
test_ansi.rb
require "helper"

class TestAnsi < JekyllUnitTest
  context nil do
    setup do
      @subject = Jekyll::Utils::Ansi
    end

    Jekyll::Utils::Ansi::COLORS.each do |color, val|
      should "respond_to? #{color}" do
        assert @subject.respond_to?(color)
      end
    end

    should "be able to strip colors" do
      assert_equal @subject.strip(@subject.yellow(@subject.red("hello"))), "hello"
    end

    should "be able to detect colors" do
      assert @subject.has?(@subject.yellow("hello"))
    end
  end
end
back to top