From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 21C31BBAF for ; Wed, 25 Mar 2009 22:13:52 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AswDADw7yknIuX5CgWdsb2JhbACVfgEBFiK8YYN1Bg X-IronPort-AV: E=Sophos;i="4.38,421,1233529200"; d="scan'208";a="37209794" Received: from mta19.f3.k8.com.br ([200.185.126.66]) by mail4-smtp-sop.national.inria.fr with ESMTP; 25 Mar 2009 22:13:51 +0100 Received: from localhost (localhost [127.0.0.1]) by smtpa.f3.k8.com.br (Postfix) with ESMTP id DC416280009C for ; Wed, 25 Mar 2009 21:13:47 +0000 (GMT) X-Virus-Scanned: amavisd-new at k8.com.br Received: from smtpa.f3.k8.com.br ([127.0.0.1]) by localhost (mta19.f3.k8.com.br [127.0.0.1]) (amavisd-new, port 10024) with LMTP id q-0IaAvzoJMm for ; Wed, 25 Mar 2009 21:13:47 +0000 (GMT) Received: from [189.106.60.171] (unknown [189.106.60.171]) by smtpa.f3.k8.com.br (Postfix) with ESMTP id 925792800099 for ; Wed, 25 Mar 2009 21:13:46 +0000 (GMT) Subject: [ANN] OSpec - BDD for OCaml From: Andre Nathan To: caml-list@inria.fr Content-Type: text/plain Date: Wed, 25 Mar 2009 18:18:12 -0300 Message-Id: <1238015892.5992.20.camel@homesick> Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; ocaml:01 ocaml:01 camlp:01 syntax:01 syntax:01 camlp:01 nathan:98 tree:02 library:03 library:03 let:03 extension:06 probably:07 describe:07 divisible:09 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