# encoding: UTF-8

require 'codeclimate-test-reporter'
require 'stringio'

CodeClimate::TestReporter.start do
  add_filter '/spec/'
end

$LOAD_PATH.unshift File.dirname(__FILE__) + '/../lib'

def capture_stdout(&_block)
  original_stdout = $stdout
  $stdout = fake = StringIO.new
  begin
    yield
  ensure
    $stdout = original_stdout
  end
  fake.string
end

# encoding: UTF-8

require 'codeclimate-test-reporter'
require 'stringio'

if ENV['CODECLIMATE_REPO_TOKEN']
  CodeClimate::TestReporter.start do
    add_filter '/spec/'
  end
end

$LOAD_PATH.unshift File.dirname(__FILE__) + '/../lib'

def capture_stdout(&_block)
  original_stdout = $stdout
  $stdout = fake = StringIO.new
  begin
    yield
  ensure
    $stdout = original_stdout
  end
  fake.string
end

Use CodeClimate only if ENVs defined
Use CodeClimate only if ENVs defined
