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-0.31.0 lib/knapsack_pro/runners/rspec_runner.rb
knapsack_pro-0.30.0 lib/knapsack_pro/runners/rspec_runner.rb
knapsack_pro-0.29.0 lib/knapsack_pro/runners/rspec_runner.rb
knapsack_pro-0.28.1 lib/knapsack_pro/runners/rspec_runner.rb
knapsack_pro-0.28.0 lib/knapsack_pro/runners/rspec_runner.rb
knapsack_pro-0.27.0 lib/knapsack_pro/runners/rspec_runner.rb
knapsack_pro-0.26.0 lib/knapsack_pro/runners/rspec_runner.rb
knapsack_pro-0.25.0 lib/knapsack_pro/runners/rspec_runner.rb
knapsack_pro-0.24.0 lib/knapsack_pro/runners/rspec_runner.rb
knapsack_pro-0.23.0 lib/knapsack_pro/runners/rspec_runner.rb
knapsack_pro-0.22.0 lib/knapsack_pro/runners/rspec_runner.rb
knapsack_pro-0.21.0 lib/knapsack_pro/runners/rspec_runner.rb
knapsack_pro-0.20.0 lib/knapsack_pro/runners/rspec_runner.rb
knapsack_pro-0.19.0 lib/knapsack_pro/runners/rspec_runner.rb
knapsack_pro-0.18.0 lib/knapsack_pro/runners/rspec_runner.rb
knapsack_pro-0.17.0 lib/knapsack_pro/runners/rspec_runner.rb
knapsack_pro-0.16.0 lib/knapsack_pro/runners/rspec_runner.rb
knapsack_pro-0.15.2 lib/knapsack_pro/runners/rspec_runner.rb
knapsack_pro-0.15.1 lib/knapsack_pro/runners/rspec_runner.rb
knapsack_pro-0.15.0 lib/knapsack_pro/runners/rspec_runner.rb