Sha256: 9195defdfec6b9740b4b03960be973cfc6daeda1890d253d727806f43c718445

Contents?: true

Size: 906 Bytes

Versions: 2

Compression:

Stored size: 906 Bytes

Contents

#include <specs/specs.h>

using namespace bandit::Matchers;

SPEC_BEGIN(Matchers::BeNull)

describe("be_null matcher", [&]{
    describe("when the value is a pointer to a built-in type", [&]{
        int* value;

        describe("which is NULL", [&]{
            before_each([&]{
                value = NULL;
            });

	    it("must pass a positive match", [&]{
		value must be_null;
	    });

	    it("must reject a negative match", [&]{
		AssertThrows(std::exception, [&]{ value must_not be_null; }());
	    });
        });

        describe("which is not NULL", [&]{
            int i = 7;

            before_each([&]{
                value = &i;
            });

	    it("must pass a negative match", [&]{
		value must_not be_null;
	    });

	    it("must reject a positive match", [&]{
		AssertThrows(std::exception, [&]{ value must be_null; }());
	    });
        });
    });
});

SPEC_END

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
tree-sitter-0.1.0 ext/tree-sitter/tree-sitter/externals/bandit/specs/matchers/be_null.cpp
tree-sitter-0.0.1 ext/tree-sitter/tree-sitter/externals/bandit/specs/matchers/be_null.cpp