[Caml-list] [ANN] OSpec 0.2.0 - BDD for OCaml

8 views
Skip to first unread message

Andre Nathan

unread,
Apr 19, 2009, 2:12:31 PM4/19/09
to caml...@inria.fr
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

_______________________________________________
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

Reply all
Reply to author
Forward
0 new messages