summaryrefslogtreecommitdiffstats
path: root/test/test_helper.rb
blob: 9067d91343e0016d2fb5d210125bcaf4ae009f82 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
require 'bundler'

begin
  require 'simplecov'
  SimpleCov.start do
    add_filter '/test/'
    add_filter '/vendor/' # for travis-ci
    add_filter do |source_file|
      source_file.lines.count < 15
    end
    # source: https://travis-ci.org/zenhob/hcl
    minimum_coverage case RUBY_ENGINE
      when "rbx" then 84
      when "jruby" then 73
      else 78
    end
  end
rescue LoadError => e
  $stderr.puts 'No test coverage tools found, skipping coverage check.'
end

# override the default hcl dir
ENV['HCL_DIR'] = File.dirname(__FILE__)+"/dot_hcl"

require 'hcl'
require 'minitest/autorun'
require 'mocha/setup'
require 'fileutils'
require 'fakeweb'

# require test extensions/helpers
Dir[File.dirname(__FILE__) + '/ext/*.rb'].each { |ext| require ext }

class HCl::TestCase < MiniTest::Unit::TestCase; end