VoQn/js-practice — pull request #10 by VoQn (2012-07-04 22:25:29+00:00)
Title: BDD Style 'Subject'

# Example Test (CoffeeScript)
``` coffeescript
runTests testGroup
'(x) -> x * x': subject ((x) -> x * x)
'x = 0 => 0': (topic) -> topic(0).to_be 0
'x = 1 => 1': (topic) -> topic(1).to_be 1
'x = -1 => 1': (topic) -> topic(-1).to_be 1
'x = 3 => 9': (topic) -> topic(3).to_be 9
'x = -2 => 4': (topic) -> topic(-2).to_be 4

'(x) -> x + x': subject ((x) -> x - x) # <- miss coding
'x = 0 => 0': (topic) -> topic(0).to_be 0
'x = 1 => 2': (topic) -> topic(1).to_be 2 # failed case
```

## Output
```
☼ (x) -> x * x: passed 5 case
✓ x = 0 => 0
✓ x = 1 => 1
✓ x = -1 => 1
✓ x > 3 => 9
✓ x < -2 => 4
☁ (x) -> x + x: failed 1 case
✓ x = 0 => 0
✘ x = 1 => 2
Result
success	| false
expected	| 2
actual	| 0
reason	| different
exception	| none

success: 6, failed: 1, total: 7
```