Sha256: dc58d8c931600ef8979b4949e6c78eed14a726e8440080145599ba9afde1281c

Contents?: true

Size: 1.04 KB

Versions: 3

Compression:

Stored size: 1.04 KB

Contents

# Running specs by default will use VCR.
# Can disable via: VCR=0 rake or clean out vcr fixtures via rake clean:vcr.
# Using a ENV VCR flag so that both ruby and cli specs always either use
# vcr or do not use vcr.  It's confusing to only have only ruby use vcr
# and cli specs not using vcr and vice versa.
ENV['VCR'] ? ENV['VCR'] : ENV['VCR'] = '1'
ENV['TEST'] = '1'

require 'simplecov'
SimpleCov.start

require "pp"

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

module Helpers
  def execute(cmd)
    puts "Running: #{cmd}" if ENV['DEBUG']
    out = `#{cmd}`
    puts out if ENV['DEBUG']
    out
  end
end

RSpec.configure do |c|
  c.include Helpers
  c.before(:all) do
    FileUtils.mkdir('tmp') unless File.exist?('tmp')
    FileUtils.rm_rf("tmp")
    FileUtils.mkdir("tmp")
  end
  c.around(:each) do |example|
    VCR.use_cassette(example.metadata[:full_description], :serialize_with => :json) do
      example.run
    end if ENV['VCR'] == '1'
  end
end

VCR.configure do |config|
  config.ignore_hosts 'codeclimate.com'
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
thor_template-2.0.2 spec/spec_helper.rb
thor_template-2.0.1 spec/spec_helper.rb
thor_template-2.0.0 spec/spec_helper.rb