I would like to announce the availability of OSpec, an RSpec-inspired
Behavior-Driven Development library for OCaml using a Camlp4 syntax
extension. It is available at
http://github.com/andrenth/ospec/tree/master
Here's a simple example of OSpec's syntax:
describe "An even number" do
it "should be divisible by two" do
let divisible_by_two x = x mod 2 = 0 in
42 should be divisible_by_two
done;
(* or simply: *)
it "should be divisible by two" do
(42 mod 2) should = 0
done
done
I must say that this is the first time I use Camlp4 (in fact I started
writing this to learn about it), so there are probably better ways to
accomplish the functionality that OSpec provides. The code is horrible
and it will make your eyes bleed. However, since there was a question
about the availability of such a library recently on the list, I decided
to make it public. Maybe I can get some contributions to this :)
Best regards,
Andre
_______________________________________________
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs