How to pass spaces in table (specflow scenario)?

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.


You can work around it by adding an extra step. Something like:

Given the following books
|Author         | Title |
Add append <5> spaces to book title

Edit:

A complete feature can look something like:

Scenario: Adding books with spaces in the title
Given the following book
| price | title |
And <5> spaces appended to a title
When book is saved
Then the title should be equals to <title without spaces>

Tags:

Specflow