Sha256: 1e8819f8725c03eded168477fe39008751170ea3dfb8b5164b74106d28700dde

Contents?: true

Size: 597 Bytes

Versions: 8

Compression:

Stored size: 597 Bytes

Contents

# -*- ruby -*-

# special thanks to Pat Eyler, Sean Carley, and Rob Sanheim
# and to Peter Havens for rspec patches
module Autotest::RedGreen
  BAR       = "=" * 78
  REDCODE   = 31
  GREENCODE = 32

  Autotest.add_hook :ran_command do |at|
    green = case at.results.last
            when /^.* (\d+) failures, (\d+) errors$/   # Test::Unit
              ($1 == "0" and $2 == "0")
            when /^\d+\s+examples?,\s+(\d+)\s+failure/ # RSpec
              ($1 == "0")
            end

    code = green ? GREENCODE : REDCODE
    puts "\e[#{ code }m#{ BAR }\e[0m\n\n" unless green.nil?
  end
end

Version data entries

8 entries across 8 versions & 3 rubygems

Version Path
grosser-autotest-4.0.3 lib/autotest/redgreen.rb
grosser-autotest-4.0.4 lib/autotest/redgreen.rb
ryanbriones-ZenTest-3.11.1 lib/autotest/redgreen.rb
ZenTest-3.9.3 lib/autotest/redgreen.rb
ZenTest-3.10.0 lib/autotest/redgreen.rb
ZenTest-3.11.0 lib/autotest/redgreen.rb
ZenTest-3.11.1 lib/autotest/redgreen.rb
ZenTest-4.0.0 lib/autotest/redgreen.rb