Sha256: 93275ed19357855bc75c8436d1c255962095ed97eaf1eb6f4324acbbd364a559

Contents?: true

Size: 719 Bytes

Versions: 7

Compression:

Stored size: 719 Bytes

Contents

ENV['TEST'] = '1'

# CodeClimate test coverage: https://docs.codeclimate.com/docs/configuring-test-coverage
# require 'simplecov'
# SimpleCov.start

require "pp"

root = File.expand_path('../../', __FILE__)
require "#{root}/lib/cli-template"

module Helper
  def execute(cmd)
    puts "Running: #{cmd}" if show_command?
    out = `#{cmd}`
    puts out if show_command?
    out
  end

  # Added SHOW_COMMAND because DEBUG is also used by other libraries like
  # bundler and it shows its internal debugging logging also.
  def show_command?
    ENV['DEBUG'] || ENV['SHOW_COMMAND']
  end
end

RSpec.configure do |c|
  c.include Helper
  c.before(:all) do
    FileUtils.rm_rf("tmp")
    FileUtils.mkdir_p("tmp")
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
cli-template-4.0.2 spec/spec_helper.rb
cli-template-4.0.1 spec/spec_helper.rb
cli-template-4.0.0 spec/spec_helper.rb
cli-template-3.5.1 spec/spec_helper.rb
cli-template-3.5.0 spec/spec_helper.rb
cli-template-3.4.0 spec/spec_helper.rb
cli-template-3.3.0 spec/spec_helper.rb