test/helper.rb in fluent-plugin-kubernetes-0.3.0 vs test/helper.rb in fluent-plugin-kubernetes-0.3.1

- old
+ new

@@ -14,13 +14,35 @@ # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # -require 'rubygems' -require 'bundler' +require "simplecov" +require "codeclimate-test-reporter" +if ENV['CIRCLE_ARTIFACTS'] + dir = File.join("..", "..", "..", ENV['CIRCLE_ARTIFACTS'], "coverage") + SimpleCov.coverage_dir(dir) +end + +SimpleCov.add_filter 'vendor' + +SimpleCov.start do + formatter SimpleCov::Formatter::MultiFormatter[ + SimpleCov::Formatter::HTMLFormatter, + CodeClimate::TestReporter::Formatter + ] +end + begin + require "bundler" +rescue LoadError => e + STDERR.puts e.message + STDERR.puts "Run `gem install bundler` to install Bundler." + exit e.status_code +end + +begin Bundler.setup(:default, :development) rescue Bundler::BundlerError => e $stderr.puts e.message $stderr.puts "Run `bundle install` to install missing gems" exit e.status_code @@ -40,9 +62,21 @@ end } $log = nulllogger end +require "minispec-metadata" +require "vcr" +require "minitest-vcr" +require "webmock" + +VCR.configure do |c| + c.cassette_library_dir = 'test/cassettes' + c.hook_into :excon, :webmock + c.filter_sensitive_data('<DOCKER_HOST>') { Docker.url.sub(/tcp\:/, 'https:') } + c.ignore_hosts 'codeclimate.com' +end + +MinitestVcr::Spec.configure! + require 'fluent/plugin/out_kubernetes' -class Test::Unit::TestCase -end \ No newline at end of file