https://github.com/jekyll/jekyll
Raw File
Tip revision: 50dbf1ace788e1f99ec6ddf2b3ea1d5720e5d56f authored by olivia on 25 January 2018, 18:22:48 UTC
Release :gem: 3.7.1
Tip revision: 50dbf1a
test_ansi.rb
# frozen_string_literal: true

require "helper"

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

    Jekyll::Utils::Ansi::COLORS.each_key do |color|
      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