<commit_before>require 'stringio'
require 'test/unit'
require 'rubygems'
require 'capistrano/logger'

class CapistranoMock

  def logbuf
    @logbuf ||= StringIO.new
  end

  def logger
    if @logger.nil?
      @logger = Capistrano::Logger.new :output=>logbuf
      @logger.level = Capistrano::Logger::MAX_LEVEL
    end
    @logger
  end

end<commit_msg>basic invocation tests<commit_after>require 'stringio'
require 'test/unit'
require 'rubygems'
require 'capistrano/logger'
require 'capistrano/configuration/variables'

class CapistranoMock

  include Capistrano::Configuration::Variables
  
  attr_reader :invocations

  def logbuf
    @logbuf ||= StringIO.new
  end

  def logger
    if @logger.nil?
      @logger = Capistrano::Logger.new :output=>logbuf
      @logger.level = Capistrano::Logger::MAX_LEVEL
    end
    @logger
  end

  %w(invoke_command capture stream).each do |k|
    class_eval %Q{
  def #{k}(*args, &block)
    args = [args]
    args << block if block
    ((@invocations ||= {})[:#{k}] ||= []) << args
  end
}
  end

end
{'fraction_non_alphanumeric': 0.12248803827751197, 'fraction_numerical': 0.0, 'mean_word_length': 3.648888888888889, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1302009', 'n_tokens_mistral': 360, 'n_tokens_neox': 352, 'n_words': 84}