hadley/testthat — pull request #132 by dirkschumacher (2014-03-01 11:32:00+00:00)
Title: Proposal: a language for BDD-style tests

Hi,

I personally like it to sometimes write tests in a more BDD kind of way. Therefore I added a little BDD oriented testing language. It is inspired by RSpec [1] for Ruby and Mocha [2] for JavaScript; in fact it pretty much looks like a nicer Mocha syntax.

At work I built a larger software component in R and it'd be really nice to be able to use this kind of syntax for some of the functions/components.

Please tell me what you think. I guess there's probably some more work to do. I also assume that I didn't break anything, as all other tests are green :)

Thanks
Dirk

```R
describe("matrix", {
it("can be multiplied by a scalar", {
m1 <- matrix(1:4, 2, 2)
m2 <- m1 * 2
expect_equivalent(matrix(1:4 * 2, 2, 2), m2)
})
it("can have not yet tested specs")
})
```

1: http://rspec.info/
2: http://visionmedia.github.io/mocha/