spockframework / spockframework/spock

Please add placeholder replacement to documentary strings in given/when/then

Open
#406 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Module-Core Type-NewFeature
Dominant language
Java
Stars
3.6k
Forks
483
PR merge metrics
No merged PRs in 30d

Description

Originally reported on Google Code with ID 284

For supporting the idea of fine grained reporting out of specs (e.g. https://github.com/damage-control/report)
it would be very helpful when documentary texts after the block-labels could contain
placeholders

e.g.

def "Account can handle withdrawals"() {
    given: "an account with balance of #oldBalance"
    ...

    when: "withdrawing an amount of #withdrawal"
    ...

    then: "the account should have a balance of #newBalance"
    ...

    where:
    oldBalance | withdrawal || newBalance
    ...
}

Reported by klaus@jumio.com on 2012-11-21 09:23:44

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files or tests. Start by locating the implementation and tests for documentary text after given/when/then labels, then trace how where-table values are exposed during reporting. Done means placeholders in those texts are replaced with the corresponding data-table values, as shown in the example.

Written by the indexing model from the issue text.

Assessment

Tech stack
groovy
Domain
testing
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.