https://github.com/jekyll/jekyll
Raw File
Tip revision: 6f2d1591fcfb61e27347defb7e5f3df846fe6e9c authored by Parker Moore on 05 October 2016, 18:47:43 UTC
Release :gem: 3.3.0.pre.rc1
Tip revision: 6f2d159
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