Class: Busser::RunnerPlugin::Minitest

Inherits:
Base
  • Object
show all
Defined in:
lib/busser/runner_plugin/minitest.rb

Overview

A Busser runner plugin for Minitest.

Author:

Instance Method Summary collapse

Instance Method Details

#testObject



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/busser/runner_plugin/minitest.rb', line 32

def test
  minitest_path = suite_path("minitest")
  runner = File.join(File.dirname(__FILE__), %w[.. minitest runner.rb])

  if File.exist?(File.join(minitest_path, "Gemfile"))
    banner("Gemfile found, bundle installing...")

    # Bundle install local completes quickly if the gems are already found
    # locally it fails if it needs to talk to the internet. The || below is
    # the fallback to the internet-enabled version. It's a speed
    # optimization.
    Dir.chdir(minitest_path) do
      run("PATH=#{ENV["PATH"]}:#{Gem.bindir}; " \
        "bundle install --local || bundle install")
    end
  end

  run_ruby_script!("#{runner} #{minitest_path}")
end