Version française
Home     About     Download     Resources     Contact us    
Browse thread
[ANN] OSpec - BDD for OCaml
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Andre Nathan <andre@d...>
Subject: [ANN] OSpec - BDD for OCaml
Hello

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