Class: Cucumber::Rake::Task::InProcessCucumberRunner

Inherits:
Object
  • Object
show all
Includes:
Rake::DSL
Defined in:
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-8.0.0/lib/cucumber/rake/task.rb

Overview

:nodoc:

Constant Summary

Constants included from Rake::FileUtilsExt

Rake::FileUtilsExt::DEFAULT

Constants included from FileUtils

FileUtils::LN_SUPPORTED, FileUtils::RUBY

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Rake::FileUtilsExt

#nowrite, #rake_check_options, #rake_output_message, #verbose, #when_writing

Methods included from FileUtils

#ruby, #safe_ln, #sh, #split_all

Constructor Details

#initialize(libs, cucumber_opts, feature_files) ⇒ InProcessCucumberRunner

Returns a new instance of InProcessCucumberRunner.



38
39
40
41
42
43
44
45
46
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-8.0.0/lib/cucumber/rake/task.rb', line 38

def initialize(libs, cucumber_opts, feature_files)
  raise 'libs must be an Array when running in-process' unless libs.instance_of? Array

  libs.reverse_each { |lib| $LOAD_PATH.unshift(lib) }
  @args = (
    cucumber_opts +
    feature_files
  ).flatten.compact
end

Instance Attribute Details

#argsObject (readonly)

Returns the value of attribute args.



36
37
38
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-8.0.0/lib/cucumber/rake/task.rb', line 36

def args
  @args
end

Instance Method Details

#runObject



48
49
50
51
52
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-8.0.0/lib/cucumber/rake/task.rb', line 48

def run
  require 'cucumber/cli/main'
  failure = Cucumber::Cli::Main.execute(args)
  raise 'Cucumber failed' if failure
end