2017 © Pedro Peláez
 

library hhassert

Simple assertion library for Hack

image

hhspecify/hhassert

Simple assertion library for Hack

  • Thursday, June 25, 2015
  • by holyshared
  • Repository
  • 1 Watchers
  • 0 Stars
  • 0 Installations
  • Hack
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

hhassert

hhassert is simple assertion library for Hack.
You can use easily as assert module of nodejs., (*1)

Build Status HHVM Status Dependency Status, (*2)

Basic Usage

It will specify the hhassert\Assert in the use keyword., (*3)

use hhassert\Assert;

Assert::ok(1 === 1);      //Passed
Assert::ok("a" === "b");  //Failed

Assert::equal("a", "a");  //Passed
Assert::equal(1, 1);      //Passed
Assert::equal(1.0, 2.0);  //Failed

Assert::notEqual("a", "b"); //Passed
Assert::notEqual("a", "a"); //Failed

Assert::throws(() ==> {
    throw new InvalidArgumentException("exception!!");
}, InvalidArgumentException::class);

Custom matcher

You can be the registration of the matcher in the configure method. Matcher specified in the lambda expression., (*4)

Assert::configure((ContextBuilder $builder) ==> {

    $builder->registerMatcher('custom_matcher', (...) ==> {
        list($a, $b) = func_get_args();

        if ($a !== $b) {
            throw new AssertionFailedException("custom matcher");
        }
    });

});

Assert::custom_matcher("a", "b");

Run the test

composer install
composer test

The Versions

25/06 2015

dev-master

9999999-dev

Simple assertion library for Hack

  Sources   Download

MIT

The Requires

  • hhvm >=3.5.0

 

The Development Requires

by Avatar holyshared

test assert spec hack hhvm simple

25/06 2015

0.2.0

0.2.0.0

Simple assertion library for Hack

  Sources   Download

MIT

The Requires

  • hhvm >=3.5.0

 

The Development Requires

by Avatar holyshared

test assert spec hack hhvm simple

25/06 2015

dev-develop

dev-develop

Simple assertion library for Hack

  Sources   Download

MIT

The Requires

  • hhvm >=3.5.0

 

The Development Requires

by Avatar holyshared

test assert spec hack hhvm simple

25/06 2015

0.1.0

0.1.0.0

Simple assertion library for Hack

  Sources   Download

MIT

The Requires

  • hhvm >=3.5.0

 

The Development Requires

by Avatar holyshared

test assert spec hack hhvm simple