I am Paul Wilson; Mere Complexities Limited, sells my consulting, coaching, and coding services. I am passionate about Agile, particularly Test Driven Development.


FIT, HTML, and Markdown

Fitnesse provides a convenient method of editing, running, and organising tests. It's good for teaching and demonstrations, but I wouldn't choose to use it again on a production project: it does not play well with source control and I am not satisfied with the facilities for altering functionality (ie tests) within a team environment.

The problem with naked FIT is that it works best with HTML. Direct editing is too much trouble; the WYSIWIG editors I've tried can be awkward to use: for instance, Mozilla composer requires too many mouse actions when inserting FIT Library-style single row tables; it also tends to insert br elements within cells, confusing FIT parsing. Microsoft Word html editing is a one way street and feels very wrong.

I've been experimenting with using Markdown for FIT tests: Markdown is a perl script to turn structured text into HTML, based on text email conventions. Unlike Wiki syntax, the text version of the document is readable and well formatted. It does not support tables so I'm pre-processing my FIT files before piping them through Markdown. Here's part of an example test in markdown (plus my table support):

Expenses
========

I want to record expenses, to help calculate how much money 
the company owes me, and so that I have a record for the tax man.

An expense is a virtual outgoing as opposed to an actual payment.  For
example if I buy a book costing 10 pounds using my own money then that is 
recorded as an expense; the subsequent payment of 10 pounds to myself is 
recorded separately (see "payments" story).

Validation rules
----------------

|valid and invalid expenses|
|date         |description                         |amount|valid? |reason                       |
|13-Jul-2005  |Agile Web Development with Rails    |125.50| yes   |                             |
|11-June-2005 |Agile Web Development with Rails    |      | no    | amount is required          |
|13-Jul-2005  |Agile Web Development with Rails    |  0.00| no    | amount may not be zero      |
|13-Jul-2005  |Agile Web Development with Rails    | -1.00| no    | amount may not be negative  |
|13-Jul-2005  |Agile Web Development with Rails    |fish  | no    | amount must be a number     |
|13-Jul-2005  |                                    |125.50| no    | description is required     |
|             |Agile Web Development with Rails    |125.50| no    | a date is required          |
|xxxx         |Agile Web Development with Rails    |125.50| no    | date should be a date       |
|29-Feb-2005  |Agile Web Development with Rails    |125.50| no    | date should be a valid date |
Update:Rob Lally has pointed me to Bluecloth, the Ruby implementation of Markdown. That makes life a bit easier, but at least I learnt how to pipe into a perl script from Ruby.

0 Comments:

Post a Comment

<< Home

subscribe here subscribe

About me

picture

Conference

RailsConf Europe 2008
Scotland on Rails Organiser

Previous blog posts

Blog archive

Other links: