https://github.com/jekyll/jekyll
Raw File
Tip revision: 46652548d6db94ed845d98744bc452b006facdd2 authored by dependabot[bot] on 18 December 2023, 05:12:27 UTC
Bump github/codeql-action from 2 to 3
Tip revision: 4665254
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_respond_to(@subject, 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