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.50.1 lib/knapsack_pro/runners/rspec_runner.rb
knapsack_pro-0.50.0 lib/knapsack_pro/runners/rspec_runner.rb
knapsack_pro-0.49.0 lib/knapsack_pro/runners/rspec_runner.rb
knapsack_pro-0.48.0 lib/knapsack_pro/runners/rspec_runner.rb
knapsack_pro-0.47.0 lib/knapsack_pro/runners/rspec_runner.rb
knapsack_pro-0.46.0 lib/knapsack_pro/runners/rspec_runner.rb
knapsack_pro-0.45.0 lib/knapsack_pro/runners/rspec_runner.rb
knapsack_pro-0.44.0 lib/knapsack_pro/runners/rspec_runner.rb
knapsack_pro-0.43.0 lib/knapsack_pro/runners/rspec_runner.rb
knapsack_pro-0.42.0 lib/knapsack_pro/runners/rspec_runner.rb
knapsack_pro-0.41.0 lib/knapsack_pro/runners/rspec_runner.rb
knapsack_pro-0.40.0 lib/knapsack_pro/runners/rspec_runner.rb
knapsack_pro-0.39.0 lib/knapsack_pro/runners/rspec_runner.rb
knapsack_pro-0.38.0 lib/knapsack_pro/runners/rspec_runner.rb
knapsack_pro-0.37.0 lib/knapsack_pro/runners/rspec_runner.rb
knapsack_pro-0.36.0 lib/knapsack_pro/runners/rspec_runner.rb
knapsack_pro-0.35.0 lib/knapsack_pro/runners/rspec_runner.rb
knapsack_pro-0.34.0 lib/knapsack_pro/runners/rspec_runner.rb
knapsack_pro-0.33.0 lib/knapsack_pro/runners/rspec_runner.rb
knapsack_pro-0.32.0 lib/knapsack_pro/runners/rspec_runner.rb