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.

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 feature directory/ies

  • :bundler (Boolean)

    use bundler or not

  • :rvm (Array<String>)

    a list of rvm version to use for the test

  • :notification (Boolean)

    show notifications

  • :command_prefix (String)

    allows adding an additional prefix to the cucumber command. Ideal for running xvfb-run for terminal only cucumber tests.

Returns:

  • (Boolean)

    the status of the execution



20
21
22
23
24
25
26
27
28
29
# File 'lib/guard/cucumber/runner.rb', line 20

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

  message = options[:message] || (paths == ['features'] ? "Running all Cucumber features: #{ cucumber_command(paths, options) }" : "Running Cucumber features: #{ cucumber_command(paths, options) }")
  paths   = options[:focus_on] ? Focuser.focus(paths, options[:focus_on]) : paths

  UI.info message, :reset => true

  system(cucumber_command(paths, options))
end