Sha256: 32e1ee3d4152afb2ba90757dfb37342eb187c148418464687184a75e88d65b5b

Contents?: true

Size: 811 Bytes

Versions: 80

Compression:

Stored size: 811 Bytes

Contents

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

        runner = new(KnapsackPro::Adapters::RSpecAdapter)

        if runner.test_files_to_execute_exist?
          require 'rspec/core/rake_task'

          task_name = 'knapsack_pro:rspec_run'
          if Rake::Task.task_defined?(task_name)
            Rake::Task[task_name].clear
          end

          RSpec::Core::RakeTask.new(task_name) do |t|
            t.rspec_opts = "#{args} --default-path #{runner.test_dir}"
            t.pattern = runner.test_file_paths
          end
          Rake::Task[task_name].invoke
        end
      end
    end
  end
end

Version data entries

80 entries across 80 versions & 1 rubygems

Version Path
knapsack_pro-1.20.2 lib/knapsack_pro/runners/rspec_runner.rb
knapsack_pro-1.20.1 lib/knapsack_pro/runners/rspec_runner.rb
knapsack_pro-1.20.0 lib/knapsack_pro/runners/rspec_runner.rb
knapsack_pro-1.19.0 lib/knapsack_pro/runners/rspec_runner.rb
knapsack_pro-1.18.2 lib/knapsack_pro/runners/rspec_runner.rb
knapsack_pro-1.18.1 lib/knapsack_pro/runners/rspec_runner.rb
knapsack_pro-1.18.0 lib/knapsack_pro/runners/rspec_runner.rb
knapsack_pro-1.17.0 lib/knapsack_pro/runners/rspec_runner.rb
knapsack_pro-1.16.1 lib/knapsack_pro/runners/rspec_runner.rb
knapsack_pro-1.16.0 lib/knapsack_pro/runners/rspec_runner.rb
knapsack_pro-1.15.0 lib/knapsack_pro/runners/rspec_runner.rb
knapsack_pro-1.14.0 lib/knapsack_pro/runners/rspec_runner.rb
knapsack_pro-1.13.0 lib/knapsack_pro/runners/rspec_runner.rb
knapsack_pro-1.12.1 lib/knapsack_pro/runners/rspec_runner.rb
knapsack_pro-1.12.0 lib/knapsack_pro/runners/rspec_runner.rb
knapsack_pro-1.11.0 lib/knapsack_pro/runners/rspec_runner.rb
knapsack_pro-1.10.1 lib/knapsack_pro/runners/rspec_runner.rb
knapsack_pro-1.10.0 lib/knapsack_pro/runners/rspec_runner.rb
knapsack_pro-1.9.0 lib/knapsack_pro/runners/rspec_runner.rb
knapsack_pro-1.8.0 lib/knapsack_pro/runners/rspec_runner.rb