pending

pending

pending marks an example as not yet implemented and records a human-readable reason. The example is registered, counted, and reported under the PENDING bucket in the runner output, but its body is not executed.

describe 'PaymentProcessor', {
  pending 'refunds: needs integration with the new gateway', {
    expect(processor.refund(100)).to.be-a(Refund);
  }
}

The runner output for the above renders the description in yellow and prints ⮑ PENDING underneath, and the final summary includes a N pending count alongside passes and failures.

Forms

pending has two forms:

pending 'reason', { ... }   # reason + placeholder block (block not executed)
pending 'reason';           # reason only, no block

Both forms accept the same metadata keys as it (:tag, :tags, arbitrary :meta):

pending 'rewrite once we drop Raku 6.c', :tag<tech-debt>, {
  expect(legacy-api()).to.be(deprecated);
}

pending vs xit

pending and xit both prevent the block from running, but they convey different intent and report under different buckets:

block runs?bucketwhen to use
xitnoSKIPPEDtests temporarily not relevant (broken fixture, env mismatch)
pendingnoPENDINGfunctionality not yet implemented, with a written reason

If you have functionality that should eventually work and you want a reminder, use pending. If you have a test that's noise or wrong for the current run, use xit.

Reading the reason

The reason is stored on the example as both the description and as pending-reason metadata:

my $ex = registry().suites[0].groups[0].examples[0];
say $ex.description;                       # "rewrite once we drop Raku 6.c"
say $ex.get-metadata('pending-reason');    # "rewrite once we drop Raku 6.c"

Tools that walk the spec tree can use the pending-reason metadata key to surface a TODO list of unfinished work alongside ordinary test results.

BDD::Behave v0.9.4

Behavior driven development framework

Authors

  • Greg Donald

License

Artistic-2.0

Dependencies

Provides

  • BDD::Behave
  • BDD::Behave::Benchmark
  • BDD::Behave::Benchmark::Baseline
  • BDD::Behave::Benchmark::Format
  • BDD::Behave::Bisect
  • BDD::Behave::Colors
  • BDD::Behave::Configuration
  • BDD::Behave::Coverage
  • BDD::Behave::DSL
  • BDD::Behave::Diff
  • BDD::Behave::DocExtractor
  • BDD::Behave::DryRun
  • BDD::Behave::Expectation
  • BDD::Behave::Failure
  • BDD::Behave::FailureStore
  • BDD::Behave::Failures
  • BDD::Behave::Files
  • BDD::Behave::Formatter
  • BDD::Behave::Formatter::Documentation
  • BDD::Behave::Formatter::HTML
  • BDD::Behave::Formatter::JSON
  • BDD::Behave::Formatter::JUnit
  • BDD::Behave::Formatter::JsonEvents
  • BDD::Behave::Formatter::Progress
  • BDD::Behave::Formatter::Registry
  • BDD::Behave::Formatter::TAP
  • BDD::Behave::Formatter::Tree
  • BDD::Behave::LetRuntime
  • BDD::Behave::Matcher
  • BDD::Behave::Matcher::Async
  • BDD::Behave::Matcher::Boolean
  • BDD::Behave::Matcher::Change
  • BDD::Behave::Matcher::Collection
  • BDD::Behave::Matcher::Core
  • BDD::Behave::Matcher::Custom
  • BDD::Behave::Matcher::Exception
  • BDD::Behave::Matcher::Numeric
  • BDD::Behave::Matcher::String
  • BDD::Behave::Matcher::Type
  • BDD::Behave::Mock::Allow
  • BDD::Behave::Mock::ArgMatcher
  • BDD::Behave::Mock::Double
  • BDD::Behave::Mock::HaveReceived
  • BDD::Behave::Mock::Spy
  • BDD::Behave::Mock::Stub
  • BDD::Behave::Parallel
  • BDD::Behave::Parallel::Distribution
  • BDD::Behave::Parallel::EventStream
  • BDD::Behave::Parallel::Manifest
  • BDD::Behave::Parallel::Queue
  • BDD::Behave::Parallel::WorkerPool
  • BDD::Behave::Runner
  • BDD::Behave::SharedContexts
  • BDD::Behave::SharedExamples
  • BDD::Behave::Slang
  • BDD::Behave::SpecLoader
  • BDD::Behave::SpecRegistry
  • BDD::Behave::SpecTree
  • BDD::Behave::SpecTree::Core
  • BDD::Behave::SpecTree::Example
  • BDD::Behave::SpecTree::ExampleGroup
  • BDD::Behave::SpecTree::Suite
  • BDD::Behave::Time
  • BDD::Behave::TypeName
  • BDD::Behave::Version
  • BDD::Behave::Watch
  • BDD::Behave::Watch::Session
  • BDD::Behave::Watch::SmartSelector
  • BDD::Behave::Watch::UI
  • BDD::Behave::Watch::Watcher
  • BDD::Behave::Worker

The Camelia image is copyright 2009 by Larry Wall. "Raku" is trademark of the Yet Another Society. All rights reserved.