if ENV['COVERAGE']
  require 'simplecov'

  SimpleCov.profiles.define 'gem' do
    add_filter '/spec/'
    add_filter '/features/'
    add_filter '/vendor/'

    add_group 'Libraries', '/lib/'
  end

  SimpleCov.start 'gem'
end

require 'bundler/setup'
require 'vcloud/core'
require 'support/stub_fog_interface.rb'

if ENV['COVERAGE']
  SimpleCov.at_exit do
    SimpleCov.result.format!
    # do not change the coverage percentage, instead add more unit tests to fix coverage failures.
    if SimpleCov.result.covered_percent < 71
      print "ERROR::BAD_COVERAGE\n"
      print "Coverage is less than acceptable limit(71%). Please add more tests to improve the coverage"
      exit(1)
    end
  end
end

if ENV['COVERAGE']
  require 'simplecov'

  SimpleCov.profiles.define 'gem' do
    add_filter '/spec/'
    add_filter '/features/'
    add_filter '/vendor/'

    add_group 'Libraries', '/lib/'
  end

  SimpleCov.start 'gem'
end

require 'bundler/setup'
require 'vcloud/core'
require 'support/stub_fog_interface.rb'

if ENV['COVERAGE']
  SimpleCov.at_exit do
    SimpleCov.result.format!
    # do not change the coverage percentage, instead add more unit tests to fix coverage failures.
    if SimpleCov.result.covered_percent < 81
      print "ERROR::BAD_COVERAGE\n"
      print "Coverage is less than acceptable limit(81%). Please add more tests to improve the coverage"
      exit(1)
    end
  end
end

Increase test coverage threshold to 81%
Increase test coverage threshold to 81%

We currently have 83.5% coverage. So increase by 10%.
