Sha256: e327c16726f01e3b7603cab8f983ee8d5decf7c3e4b12f6cff8643e7f9f1b95e

Contents?: true

Size: 894 Bytes

Versions: 9

Compression:

Stored size: 894 Bytes

Contents

module KnapsackPro
  module Runners
    class MinitestRunner < BaseRunner
      def self.run(args)
        ENV['KNAPSACK_PRO_TEST_SUITE_TOKEN'] = KnapsackPro::Config::Env.test_suite_token_minitest
        ENV['KNAPSACK_PRO_RECORDING_ENABLED'] = 'true'

        adapter_class = KnapsackPro::Adapters::MinitestAdapter
        runner = new(adapter_class)

        if runner.test_files_to_execute_exist?
          adapter_class.verify_bind_method_called

          task_name = 'knapsack_pro:minitest_run'

          if Rake::Task.task_defined?(task_name)
            Rake::Task[task_name].clear
          end

          Rake::TestTask.new(task_name) do |t|
            t.warning = false
            t.libs << runner.test_dir
            t.test_files = runner.test_file_paths
            t.options = args
          end

          Rake::Task[task_name].invoke
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
knapsack_pro-2.18.1 lib/knapsack_pro/runners/minitest_runner.rb
knapsack_pro-2.18.0 lib/knapsack_pro/runners/minitest_runner.rb
knapsack_pro-2.17.0 lib/knapsack_pro/runners/minitest_runner.rb
knapsack_pro-2.16.0 lib/knapsack_pro/runners/minitest_runner.rb
knapsack_pro-2.15.0 lib/knapsack_pro/runners/minitest_runner.rb
knapsack_pro-2.14.0 lib/knapsack_pro/runners/minitest_runner.rb
knapsack_pro-2.13.0 lib/knapsack_pro/runners/minitest_runner.rb
knapsack_pro-2.12.0 lib/knapsack_pro/runners/minitest_runner.rb
knapsack_pro-2.11.0 lib/knapsack_pro/runners/minitest_runner.rb