Class: Baleen::Task::Cucumber

Inherits:
Base
  • Object
show all
Includes:
Default, Serializable
Defined in:
lib/baleen/task/cucumber.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Default

#default_baleen_server, #default_before_command, #default_branch, #default_ci_port, #default_concurrency, #default_daemon, #default_dir, #default_docker_host, #default_docker_port, #default_features, #default_log_level, #default_port, #default_project_file, #default_work_dir

Methods included from Serializable

deserialize, #dup, #method_missing, #params, symbolize_keys, #to_json

Methods inherited from Base

#command, #command=, #commands, #respond, #result, #terminate?

Constructor Details

#initialize(opt) ⇒ Cucumber

Returns a new instance of Cucumber.



12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/baleen/task/cucumber.rb', line 12

def initialize(opt)
  super()
  @params[:bin]            = opt[:bin]            || "bundle exec cucumber"
  @params[:options]        = opt[:options]
  @params[:work_dir]       = opt[:work_dir]       || default_work_dir
  @params[:files]          = opt[:files]          || default_features
  @params[:concurrency]    = opt[:concurrency]    || default_concurrency
  @params[:before_command] = opt[:before_command] || default_before_command
  @params[:image]          = opt[:image]
  @params[:command]        = opt[:command]
  @params[:results]        = opt[:results]
  @params[:status]         = opt[:status]
  @params[:commit]         = nil
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Baleen::Serializable

Instance Attribute Details

#target_filesObject (readonly)

Returns the value of attribute target_files.



10
11
12
# File 'lib/baleen/task/cucumber.rb', line 10

def target_files
  @target_files
end

Instance Method Details

#prepareObject



27
28
29
30
31
32
33
34
35
36
# File 'lib/baleen/task/cucumber.rb', line 27

def prepare
  task = Generic.new(
    work_dir: work_dir,
    image:    image,
    command:  %{find #{files} | grep "\\.feature"}
  )
  runner = Baleen::Runner.new(task)
  result = runner.run
  @target_files = result[:stdout]
end