The
String Handler compares strings with options to ignore white space and ignore case. Cell prefixes can be used to identify the cells that use the handler, or it can be used on all cells with string types.
When
String Handler is used without any cell prefixes, it should be inserted into the cell handler list before any of the keyword handlers, so that the keyword handlers can process the cell before
String Handler does.
| configuration setup |
| set value | fit.CellHandlers | | BlankKeywordHandler | | StringHandler |
The default option is to ignore whitespace.
| string |
| field | field? |
| h e l l o | he llo |
| null | fail[he llo] |
A cell prefix can be configured to identify the cells to be compared by the handler.
| configuration setup |
| add | fitnesse.handlers.StringHandler | | w- |
| string |
| field | field? |
| h e l l o | w-he llo |
| h e l l o | fail[he llo] |
Comparison options can be configured for a cell prefix.
| configuration setup |
| add | fitnesse.handlers.StringHandler | | i-,IgnoreCase |
| add | fitnesse.handlers.StringHandler | | w*,IgnoreWhitespace |
| add | fitnesse.handlers.StringHandler | | b!,IgnoreCase,IgnoreWhitespace |
| string |
| field | field? |
| hello | i-HeLlo |
| hello | fail[i-he llo] |
| hello | fail[HeLlo] |
| h e l l o | w*he llo |
| h e l l o | b!He Llo |
Comparison options can be configured for an empty prefix.
| configuration setup |
| add | fitnesse.handlers.StringHandler | | ,IgnoreCase |
| string |
| field | field? |
| hello | HeLlo |
| h e l l o | fail[he llo] |