2015-06-11 08:11:52 -04:00
|
|
|
#!/usr/bin/env ruby
|
2017-07-09 13:41:28 -04:00
|
|
|
# frozen_string_literal: true
|
2016-08-10 18:51:05 -04:00
|
|
|
|
2017-08-18 19:44:37 -04:00
|
|
|
adapter_index = ARGV.index("--adapter") || ARGV.index("-a")
|
|
|
|
if adapter_index
|
|
|
|
ARGV.delete_at(adapter_index)
|
|
|
|
ENV["ARCONN"] = ARGV.delete_at(adapter_index).strip
|
|
|
|
end
|
|
|
|
|
2016-08-10 18:51:05 -04:00
|
|
|
COMPONENT_ROOT = File.expand_path("..", __dir__)
|
2017-06-11 08:59:23 -04:00
|
|
|
require_relative "../../tools/test"
|
2016-08-10 18:51:05 -04:00
|
|
|
|
2015-06-11 08:24:56 -04:00
|
|
|
module Minitest
|
|
|
|
def self.plugin_active_record_options(opts, options)
|
|
|
|
opts.separator ""
|
|
|
|
opts.separator "Active Record options:"
|
|
|
|
opts.on("-a", "--adapter [ADAPTER]",
|
2015-12-15 17:01:30 -05:00
|
|
|
"Run tests using a specific adapter (sqlite3, sqlite3_mem, mysql2, postgresql)") do |adapter|
|
2015-06-11 08:24:56 -04:00
|
|
|
ENV["ARCONN"] = adapter.strip
|
|
|
|
end
|
|
|
|
|
|
|
|
opts
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2017-08-18 19:44:37 -04:00
|
|
|
Minitest.load_plugins
|
2016-08-06 13:28:46 -04:00
|
|
|
Minitest.extensions.unshift "active_record"
|