Fitnesse test against empty row result

I am using Fitnesse SliM and I want to check if the result of the device is an empty string. Leaving the results field in Fitnesse blank will ignore the test, which is obviously not what I want. I could solve this by expanding the device code, but I am wondering if this can be handled in Fitnesse itself.

+6
fitnesse
source share
3 answers

Slim seems to mean an empty row as an ignore, at least for QueryTable fixture: a cell that is left empty in a table will be filled from the result and will be considered ignored.

Although this is not considered a good solution, if you really need to, you can use the regex to check on an empty string by matching on

=~/^$/ 

Another option is to use a null driver driver, as shown in http://fitnesse.org/FitNesse.SuiteAcceptanceTests.SuiteSlimTests.SlimSymbolsCanBeBlankOrNull

+6
source share

passing the word 'blank' simulates an empty string.

as:

| Check | so that the returned string is | blank |

+5
source share

In this case - when you need to check the use of SLIM, whether the result is an empty string, you can use a markup variable. Just define it somewhere on your test page, for example:

! define blank {}

And then call it anywhere:

| registration | SomeFixtureName | $ {space} |

+3
source share

All Articles