Sha256: aff4a707587616c042d558b74cae96d404b62fc1246872c7e12b0fa90b713c80

Contents?: true

Size: 614 Bytes

Versions: 9

Compression:

Stored size: 614 Bytes

Contents

require "minitest/unit"

##
# Show your testing pride!

class PrideIO
  attr_reader :io

  # stolen from /System/Library/Perl/5.10.0/Term/ANSIColor.pm
  COLORS = (31..36).to_a
  CHARS = ["*"]

  def initialize io
    @io = io
    @colors = COLORS.cycle
    @chars  = CHARS.cycle
  end

  def print o
    case o
    when "." then
      io.print "\e[#{@colors.next}m#{@chars.next}\e[0m"
    when "E", "F" then
      io.print "\e[41m\e[37m#{o}\e[0m"
    else
      io.print o
    end
  end

  def method_missing msg, *args
    io.send(msg, *args)
  end
end

MiniTest::Unit.output = PrideIO.new(MiniTest::Unit.output)

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
minitest-2.3.1 lib/minitest/pride.rb
minitest-2.3.0 lib/minitest/pride.rb
minitest-2.2.2 lib/minitest/pride.rb
minitest-2.2.1 lib/minitest/pride.rb
minitest-2.2.0 lib/minitest/pride.rb
minitest-2.1.0 lib/minitest/pride.rb
minitest-2.0.2 lib/minitest/pride.rb
minitest-2.0.1 lib/minitest/pride.rb
minitest-2.0.0 lib/minitest/pride.rb