lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Behaviour Driven Development for Lua

I am happy to announce the release of Specl release 8.

Specl's home page is at http://gvvaughan.github.io/specl

* Noteworthy changes in release 8 (2013-06-26) [stable]

** New features:

  - Can now be installed directly from a release tarball by `luarocks`.
    No need to run `./configure` or `make`, unless you want to install
    to a custom location, or do not use LuaRocks.

  - A new 'all_of' adaptor for any matcher:

     expect (mytable).should_contain.all_of {x, y, z}

  - 'contain' matcher handles std.object module derived objects by
    coercing them to tables.

  - 'equal' matcher performs a deep comparison of std.object module
    derived objects' contents.

  - `./bootstrap` runs slowly again with 4800 lines of code
    reintroduced required to automatically manage Slingshot files with
    new `bootstrap.slingshot`.  This doesn't have any direct effect on
    users, except that the Slingshot managed release process is much
    more robust, reducing the chances you'll end up with a still-born
    release.

** Bug fixes:

  - Avoid 'nan%' divide-by-zero error output from report formatter.

  - Built in report formatter displays argument strings to pending
    calls from examples consistently.

** Incompatible changes:

  - API change in matchers, generalizing the former `format_any_of` to
    `format_alternatives`, with a new `adaptor` parameter for use with
    additional matcher adaptors.

  - API change in both matchers.concat and matchers.reformat, each of
    which now take an additional `adaptor` argument, which can be
    passed in from `format_alternatives` as received so that the
    grammatically best choice of `and` or `or` is used to display the
    list of alternatives when an expectation fails.

  - Calling `require` in a spec file no longer artificially extracts
    symbols from a returned table and injects them into the local
    environment -- because it was inelegant and unnecessary.  If you
    had relied on this feature, simply capture the returned table and
    either manually copy the symbols you need or use a fully qualified
    name.  Previously:

      # Don't do this!
      before:
        require "specl.shell"
      describe spawn:
        expect (spawn "printf hello").should_output "hello"

    Much better:

      # Do this instead.
      before:
        spawn = (require "specl.shell").spawn
      describe spawn:
        expect (spawn "printf hello").should_output "hello"


Install it with LuaRocks, using:

  luarocks install specl-8

Until the rocks are available from the official repository in a few days,
you can install directly from the specl release branch, with:

  $ luarocks install \
    http://raw.github.com/gvvaughan/specl/release-v8/specl-8-1.rockspec