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

Inherits:
Object
  • Object
show all
Includes:
Rake::DSL
Defined in:
lib/cucumber/rake/task.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(libs, cucumber_opts, feature_files) ⇒ InProcessCucumberRunner



36
37
38
39
40
41
42
43
# File 'lib/cucumber/rake/task.rb', line 36

def initialize(libs, cucumber_opts, feature_files)
  raise "libs must be an Array when running in-process" unless Array === libs
  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



34
35
36
# File 'lib/cucumber/rake/task.rb', line 34

def args
  @args
end

Instance Method Details

#runObject



45
46
47
48
49
# File 'lib/cucumber/rake/task.rb', line 45

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