unclebob/fitnesse — pull request #100 by gshakhn (2012-06-15 22:40:35+00:00)
Title: Option for custom slim tables

Purpose
======

We created a few custom slim tables that are needed to tests parts of our project. These tables are only relevant for our project. This patch allows us to use our own custom tables.

Usage
=====

Run fitnesse with the `fitnesse.slimTables.SlimTableFactory` system property set to `YourCustomSlimTableFactory`.

Then, make the factory class something similar to the below.

public class YourCustomSlimTableFactory {
public SlimTable makeSlimTable(Table table, String tableId, SlimTestContext slimTestContext) {
String tableType = table.getCellContents(0, 0);
if (beginsWith(tableType, "customTableFoo:")) {
return new CustomTableFoo(table, tableId, slimTestContext)
} else {
return super.makeSlimTable(table, tableId, slimTestContext);
}
}
}

Then you can make a test like:

!|customTableFoo:|Some stuff|
|more|custom|stuff|