Commit 02a52101 authored by Eloy Duran's avatar Eloy Duran

Import Bacon color extension.

parent 69de5e8d
...@@ -6,7 +6,7 @@ process do |files| ...@@ -6,7 +6,7 @@ process do |files|
specs = files.take_and_map do |file| specs = files.take_and_map do |file|
case file case file
when %r{lib/cocoapods/installer.+\.rb$} when %r{lib/cocoapods/installer.+\.rb$}
'spec/unit/installer_spec.rb' ['spec/unit/installer_spec.rb', 'spec/unit/target_installer_spec.rb']
when %r{lib/cocoapods/(.+?)\.rb$} when %r{lib/cocoapods/(.+?)\.rb$}
s = Dir.glob("spec/**/#{$1}_spec.rb") s = Dir.glob("spec/**/#{$1}_spec.rb")
s unless s.empty? s unless s.empty?
......
...@@ -12,18 +12,23 @@ $:.unshift((ROOT + 'lib').to_s) ...@@ -12,18 +12,23 @@ $:.unshift((ROOT + 'lib').to_s)
require 'cocoapods' require 'cocoapods'
$:.unshift((ROOT + 'spec').to_s) $:.unshift((ROOT + 'spec').to_s)
require 'spec_helper/color_output'
require 'spec_helper/fixture' require 'spec_helper/fixture'
require 'spec_helper/git' require 'spec_helper/git'
require 'spec_helper/temporary_directory' require 'spec_helper/temporary_directory'
context_class = defined?(BaconContext) ? BaconContext : Bacon::Context module Bacon
context_class.class_eval do extend ColorOutput
include Pod::Config::Mixin summary_at_exit
include SpecHelper::Fixture class Context
include Pod::Config::Mixin
def argv(*argv) include SpecHelper::Fixture
Pod::Command::ARGV.new(argv)
def argv(*argv)
Pod::Command::ARGV.new(argv)
end
end end
end end
......
# Graciously yanked from https://github.com/zen-cms/Zen-Core
# MIT License
# Thanks, YorickPeterse!
#:nodoc:
module Bacon
#:nodoc:
module ColorOutput
#:nodoc:
def handle_specification(name)
puts spaces + name
yield
puts if Counter[:context_depth] == 1
end
#:nodoc:
def handle_requirement(description)
error = yield
if !error.empty?
puts "#{spaces} \e[31m- #{description} [FAILED]\e[0m"
else
puts "#{spaces} \e[32m- #{description}\e[0m"
end
end
#:nodoc:
def handle_summary
print ErrorLog if Backtraces
puts "%d specifications (%d requirements), %d failures, %d errors" %
Counter.values_at(:specifications, :requirements, :failed, :errors)
end
#:nodoc:
def spaces
if Counter[:context_depth] == 0
Counter[:context_depth] = 1
end
return ' ' * (Counter[:context_depth] - 1)
end
end # ColorOutput
end # Bacon
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment