Asserter bool()

bool() behavior

Does not contains assertions from the assertions containers.

test
        .value(test.bool(true).hasHeader)
          .isUndefined()
        .value(test.bool(true).hasProperty)
          .isUndefined()
        .value(test.bool(true).hasMessage)
          .isUndefined()
      ;

Assert that the tested value is a boolean.

test
        .bool(true)
        .bool(false)
        .case('Test failure', function(){
          test
            .exception(function(){
              test.bool();
            })
            .exception(function(){
              test.bool(0);
            })
            .exception(function(){
              test.bool(1);
            })
            .exception(function(){
              test.bool(undefined);
            })
            .exception(function(){
              test.bool(null);
            })
            .exception(function(){
              test.bool('');
            })
            .exception(function(){
              test.bool('true');
            })
            .exception(function(){
              test.bool('false');
            })
            .exception(function(){
              test.bool('1');
            })
            .exception(function(){
              test.bool('0');
            })
            .exception(function(){
              test.bool([]);
            })
            .exception(function(){
              test.bool({});
            })
            .exception(function(){
              test.bool(new Boolean('false')).isFalse(); // object
            })
            .exception(function(){
              test.bool(Boolean('false')).isFalse();
            })
          ;
        })
      ;

Assertions of bool()

isTrue().

test
        .bool(true)
          .isTrue()
        .exception(function(){
          test.bool(false).isTrue();
        })
      ;

isNotTrue().

test
        .bool(false)
          .isNotTrue()
        .exception(function(){
          test.bool(true).isNotTrue();
        })
      ;

isFalse().

test
        .bool(false)
          .isFalse()
        .exception(function(){
          test.bool(true).isFalse();
        })
      ;

isNotFalse().

test
        .bool(true)
          .isNotFalse()
        .exception(function(){
          test.bool(false).isNotFalse();
        })
      ;