ENV['RAILS_ENV'] = ENV['ENV'] = 'test' RSpec.configure do |c| c.mock_with :mocha c.before(:each) { Time.now.utc.tap { | now| Time.stubs(:now).returns(now) } } end require 'travis/cli' require 'mocha' module Mock class Shell def messages @messages ||= [] end def say(*args) messages << args end alias :error :say end end module Kernel def capture_stdout out = StringIO.new $stdout = out yield return out.string ensure $stdout = STDOUT end end