test/helper.rb in embulk-output-bigquery-0.6.9 vs test/helper.rb in embulk-output-bigquery-0.7.0
- old
+ new
@@ -2,17 +2,17 @@
require 'bundler/setup'
require 'test/unit'
require 'test/unit/rr'
+# Embulk 0.10.x introduced new bootstrap mechanism.
+# https://github.com/embulk/embulk/blob/641f35fec064cca7b1a7314d634a4b64ef8637f1/embulk-ruby/test/vanilla/run-test.rb#L8-L13
+static_initializer = Java::org.embulk.EmbulkDependencyClassLoader.staticInitializer().useSelfContainedJarFiles()
+static_initializer.java_send :initialize
+
+require 'embulk/java/bootstrap'
require 'embulk'
-begin
- # Embulk ~> 0.8.x
- Embulk.setup
-rescue NotImplementedError, NoMethodError, NameError
- # Embulk ~> 0.9.x
- require 'embulk/java/bootstrap'
-end
+
Embulk.logger = Embulk::Logger.new('/dev/null')
APP_ROOT = File.expand_path('../', __dir__)
EXAMPLE_ROOT = File.expand_path('../example', __dir__)
TEST_ROOT = File.expand_path(File.dirname(__FILE__))