Contents

total

In order to see relevant information As a command line junkie I want to calculate the total of a numeric attribute of cards

Scenario: incorrect usage of total command

  • When I run `cardigan` interactively
  • And I type "total"
  • And I type "exit"
  • Then the exit status should be 0
  • And the stdout should contain "missing required numeric total field"

Scenario: calculate total without any grouping

  • When I run `cardigan` interactively
  • And I create the following cards:
    nameestimate
    card 13
    card 22
  • And I type "total estimate"
  • And I type "exit"
  • Then the exit status should be 0
  • And the stdout should contain:
    text
     ----------
    | estimate |
     ----------
    | 5        |
     ----------

Scenario: calculate total with some missing values

  • When I run `cardigan` interactively
  • And I create the following cards:
    nameestimate
    card 13
    card 22
    card 3
  • And I type "total estimate"
  • And I type "exit"
  • Then the exit status should be 0
  • And the stdout should contain:
    text
     ----------
    | estimate |
     ----------
    | 5        |
     ----------

Scenario: calculate total without grouping by a field

  • When I run `cardigan` interactively
  • And I create the following cards:
    nameestimaterelease
    card 13ocelot
    card 22margay
    card 35margay
  • And I type "total estimate release"
  • And I type "exit"
  • Then the exit status should be 0
  • And the stdout should contain:
    text
     --------------------
    | release | estimate |
     --------------------
    | margay  | 7        |
    | ocelot  | 3        |
    |         | 10       |
     --------------------

Source: features/commands/total.feature at commit b93b5958, Cardigan (MIT license).