develooper Front page | perl.module-authors | Postings from September 2017

Is it ok taking the Refute::* namespace?

Thread Next
From:
Konstantin S. Uvarin
Date:
September 6, 2017 11:24
Subject:
Is it ok taking the Refute::* namespace?
Message ID:
CAJj2qWnrW3fh5XwuG5eQnEYYKd30FsDrQdKP3MdZxiAG=RKbvQ@mail.gmail.com
Hello,

  I would like to release a Refute or perhaps Refute::Contract module to
CPAN. I used to name it Test::Refute or Test::Contract, but it's not
actually a test module anymore.

  A refute( $reason, $comment ) is an inverted assertion: if $reason is a
false value, it is assumed to pass; otherwise it fails, and the exact
reason is already there!

  A $contract object represents a set of refutations and possibly other
things (execution plan, sidenotes, subcontracts, etc). A contract is either
fulfilled (refutations match plan), or failed.

  One can view a contract as a Test::More-based script encapsulated for
being executed and queried inside production code.

  This setup allows for very easy building of arbitrarily complex
assertions, err, refutations. For instance, is_deeply() can be recreated by
simply passing a recursive diff of two structures to refute().

  Now to the subject. Would it be fine to take up a whole top-level
namespace, or should I stick to a humbler naming scheme like
Assert::Refute? If I do take a namespace, what should I do aside from being
concerned and posting here?

  Thank you,

-- 
Konstantin S. Uvarin
skype: kuvarin
http://github.com/dallaylaen

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About