Sha256: b3078a77aedb29d2096e91cb6b4273cd7450342e51d5a41f33f7ba12f472dce7

Contents?: true

Size: 795 Bytes

Versions: 4

Compression:

Stored size: 795 Bytes

Contents

$LOAD_PATH << File.expand_path('../../lib', __FILE__)

require 'furnace'
include Furnace

module Bacon
  module ColoredOutput
    def handle_specification(name)
      puts spaces + name
      yield
      puts if Counter[:context_depth] == 1
    end

    def handle_requirement(description)
      print spaces

      error = yield

      print error.empty? ? "\e[32m" : "\e[1;31m"
      print "  - #{description}"
      puts error.empty? ? "\e[0m" : " [#{error}]\e[0m"
    end

    def handle_summary
      print ErrorLog  if Backtraces
      puts "%d specifications (%d requirements), %d failures, %d errors" %
        Counter.values_at(:specifications, :requirements, :failed, :errors)
    end

    def spaces
      "  " * (Counter[:context_depth] - 1)
    end
  end

  extend ColoredOutput
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
furnace-0.3.1 test/test_helper.rb
furnace-0.3.0 test/test_helper.rb
furnace-0.3.0.beta3 test/test_helper.rb
furnace-0.3.0.beta2 test/test_helper.rb