Search code examples
specflow

How to pass spaces in table (specflow scenario)?


How to pass spaces in table ?

Background:
    Given the following books
        |Author         |(here several spaces)Title(here several spaces)|

Solution

  • I would do this:

    Given the following books
    | Author              | Title               |
    | "J. K. Rowling"     | "Harry P     "      |
    | " Isaac Asimov   "  | "Robots and Empire" |
    

    Then your bindings can be made to strip the quotes if present, but retaining the spaces.

    I think this is much preferable to the idea of adding spaces afterward, because that isn't very human readable - quotations will make the spaces visible to the human (stakeholder / coder) reading them.