Sha256: 7b5569988e7848e138a4c5f8d9c8749e40cd7623d4f6dd674ee841bd40bd772e

Contents?: true

Size: 1.02 KB

Versions: 37

Compression:

Stored size: 1.02 KB

Contents

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

        adapter_class = KnapsackPro::Adapters::CucumberAdapter
        KnapsackPro::Config::Env.set_test_runner_adapter(adapter_class)
        runner = new(adapter_class)

        if runner.test_files_to_execute_exist?
          adapter_class.verify_bind_method_called

          KnapsackPro.tracker.set_prerun_tests(runner.test_file_paths)

          require 'cucumber/rake/task'

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

          ::Cucumber::Rake::Task.new(task_name) do |t|
            t.cucumber_opts = "#{args} --require #{runner.test_dir} -- #{runner.stringify_test_file_paths}"
          end
          Rake::Task[task_name].invoke
        end
      end
    end
  end
end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
knapsack_pro-5.5.0 lib/knapsack_pro/runners/cucumber_runner.rb
knapsack_pro-5.4.1 lib/knapsack_pro/runners/cucumber_runner.rb
knapsack_pro-5.4.0 lib/knapsack_pro/runners/cucumber_runner.rb
knapsack_pro-5.3.5 lib/knapsack_pro/runners/cucumber_runner.rb
knapsack_pro-5.3.4 lib/knapsack_pro/runners/cucumber_runner.rb
knapsack_pro-5.3.3 lib/knapsack_pro/runners/cucumber_runner.rb
knapsack_pro-5.3.2 lib/knapsack_pro/runners/cucumber_runner.rb
knapsack_pro-5.3.1 lib/knapsack_pro/runners/cucumber_runner.rb
knapsack_pro-5.3.0 lib/knapsack_pro/runners/cucumber_runner.rb
knapsack_pro-5.2.1 lib/knapsack_pro/runners/cucumber_runner.rb
knapsack_pro-5.2.0 lib/knapsack_pro/runners/cucumber_runner.rb
knapsack_pro-5.1.2 lib/knapsack_pro/runners/cucumber_runner.rb
knapsack_pro-5.1.1 lib/knapsack_pro/runners/cucumber_runner.rb
knapsack_pro-5.1.0 lib/knapsack_pro/runners/cucumber_runner.rb
knapsack_pro-5.0.0 lib/knapsack_pro/runners/cucumber_runner.rb
knapsack_pro-4.1.0 lib/knapsack_pro/runners/cucumber_runner.rb
knapsack_pro-4.0.0 lib/knapsack_pro/runners/cucumber_runner.rb
knapsack_pro-3.11.0 lib/knapsack_pro/runners/cucumber_runner.rb
knapsack_pro-3.10.0 lib/knapsack_pro/runners/cucumber_runner.rb
knapsack_pro-3.9.0 lib/knapsack_pro/runners/cucumber_runner.rb