Browse thread
[ANN] OSpec 0.2.0 - BDD for OCaml
- Andre Nathan
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: | 2009-04-19 (18:12) |
From: | Andre Nathan <andre@d...> |
Subject: | [ANN] OSpec 0.2.0 - BDD for OCaml |
Hello I'm happy to announce a new version of OSpec, a Behavior-Driven Development tool for OCaml using a Camlp4 syntax extension. You can download this release from the ocamlcore forge at http://forge.ocamlcore.org/projects/ospec/ or directly clone the repository from Github: http://github.com/andrenth/ospec/tree/master == New features: * Nested specifications: it is now possible to group related examples in a nested "describe" block. For example, describe "Person" do describe "name" do it "should not be empty" do (String.length person.name) should be > 0 done; it "should only contain valid characters" do (person.name) should match_regexp "^[A-Za-z- ]+$" done done done * Property testing (inspired by QuickCheck): OSpec can now autogenerate test cases with the "forall" keyword. For example, describe "A list" do it "should equal itself when reversed twice" do forall list l . (List.rev (List.rev l)) should = l done done This will generate lists of random length and test each one against the specified property. There are 28 predefined random sample generators for the basic OCaml types which can be used directly in tests or as building blocks for custom generators. * Better error handling: exceptions in the specifications are now caught and reported. == Bug fixes: * Properly count pending examples. OSpec is released under the MIT license. Please see the README file in the distribution for more details and examples. Best regards, Andre