Module: Guard::Cucumber::Runner

Defined in:
lib/guard/cucumber/runner.rb

Overview

The Cucumber runner handles the execution of the cucumber binary.

Class Method Summary collapse

Class Method Details

.run(paths, options = {}) ⇒ Boolean

Run the supplied features.

feature directory/ies prefix to the cucumber command. Ideal for running xvfb-run for terminal only cucumber tests.

Parameters:

  • paths (Array<String>)

    the feature files or directories

  • options (Hash) (defaults to: {})

    the options for the execution

Options Hash (options):

  • :feature_sets (Array<String>)

    a list of non-standard

  • :notification (Boolean)

    show notifications

Returns:

  • (Boolean)

    the status of the execution



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/guard/cucumber/runner.rb', line 22

def run(paths, options = {})
  return false if paths.empty?

  cmd = cucumber_command(paths, options)

  msg1 = "Running all Cucumber features: #{cmd}"
  msg2 = "Running Cucumber features: #{cmd}"
  msg = (paths == ["features"] ? msg1 : msg2)

  message = options[:message] || msg

  paths = Focuser.focus(paths, options[:focus_on]) if options[:focus_on]
  cmd = cucumber_command(paths, options)

  Compat::UI.info message, reset: true

  system(cmd)
end