Parent

PrideIO

Show your testing pride!

Constants

ESC
NND

Attributes

io[R]

Public Class Methods

new(io) click to toggle source
# File lib/minitest/pride.rb, line 12
def initialize io
  @io = io
  # stolen from /System/Library/Perl/5.10.0/Term/ANSIColor.pm
  # also reference http://en.wikipedia.org/wiki/ANSI_escape_code
  @colors ||= (31..36).to_a
  @size   = @colors.size
  @index  = 0
  # io.sync = true
end

Public Instance Methods

method_missing(msg, *args) click to toggle source
# File lib/minitest/pride.rb, line 53
def method_missing msg, *args
  io.send(msg, *args)
end
pride(string) click to toggle source
# File lib/minitest/pride.rb, line 46
def pride string
  string = "*" if string == "."
  c = @colors[@index % @size]
  @index += 1
  "#{ESC}#{c}m#{string}#{NND}"
end
puts(*o) click to toggle source
# File lib/minitest/pride.rb, line 33
def puts(*o)
  o.map! { |s|
    s.sub(/Finished tests/) {
      @index = 0
      'Fabulous tests'.split(//).map { |c|
        pride(c)
      }.join
    }
  }

  super
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.