https://github.com/jekyll/jekyll
Raw File
Tip revision: 34ef47b590e67264987468d6d6017da5ec1d7966 authored by Ashwin Maroli on 03 March 2022, 10:46:33 UTC
Release :gem: v4.2.2
Tip revision: 34ef47b
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 "hello", @subject.strip(@subject.yellow(@subject.red("hello")))
    end

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