Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to pass spaces in table (specflow scenario)?

Tags:

specflow

How to pass spaces in table ?

Background:
    Given the following books
        |Author         |(here several spaces)Title(here several spaces)|
like image 780
Roman Bats Avatar asked Oct 01 '12 15:10

Roman Bats


2 Answers

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.

like image 176
perfectionist Avatar answered Oct 24 '22 14:10

perfectionist


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>
like image 27
Void Ray Avatar answered Oct 24 '22 13:10

Void Ray