Cucumber.PendingStepError exception (Cucumber v1.0.0)

View Source

Exception raised when a step (or before hook) signals it is not yet implemented by returning :pending or {:pending, message}.

Pending follows the Cucumber semantics: the remaining steps in the scenario are skipped, after hooks still run, and the scenario as a whole fails with this error — pending work is a failure, unlike :skipped which is deliberate and non-failing.

This is a distinct exception type (rather than a Cucumber.StepError) so downstream features can treat it specially — e.g. retry logic must never retry a pending step, and Cucumber Messages report it as PENDING rather than FAILED.

Summary

Functions

Builds the error for a pending signal.

Types

t()

@type t() :: %Cucumber.PendingStepError{
  __exception__: term(),
  feature_file: String.t() | nil,
  message: String.t(),
  reason: String.t() | nil,
  scenario_name: String.t() | nil,
  step: Gherkin.Step.t() | nil
}

Functions

new(source, reason, feature_file, scenario_name)

@spec new(
  {:step, Gherkin.Step.t()} | :before_hook,
  String.t() | nil,
  String.t(),
  String.t()
) :: t()

Builds the error for a pending signal.

source is {:step, step} for a pending step definition, or :before_hook when a before hook returned the pending signal. reason is the optional message from {:pending, message}.