test/test_helper.rb in fluent-plugin-slack-0.1.1 vs test/test_helper.rb in fluent-plugin-slack-0.2.0
- old
+ new
@@ -1,20 +1,27 @@
-$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
-$LOAD_PATH.unshift(File.dirname(__FILE__))
+require 'rubygems'
+require 'bundler'
-require 'rr'
-require 'test/unit'
-class Test::Unit::TestCase
- include RR::Adapters::TestUnit
+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
end
+require 'test/unit'
-if ENV['SIMPLE_COV']
- require 'simplecov'
- SimpleCov.start do
- add_filter 'test/'
- add_filter 'pkg/'
- add_filter 'vendor/'
- end
+$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
+$LOAD_PATH.unshift(File.dirname(__FILE__))
+require 'fluent/test'
+unless ENV.has_key?('VERBOSE')
+ nulllogger = Object.new
+ nulllogger.instance_eval {|obj|
+ def method_missing(method, *args)
+ # pass
+ end
+ }
+ $log = nulllogger
end
-require 'test/unit'
-require 'fluent/test'
+require 'fluent/plugin/out_buffered_slack'
+require 'rr'