From 062cd07342edc2b003555e90dd2cee0514b9f64a Mon Sep 17 00:00:00 2001 From: Bardur Arantsson Date: Mon, 23 Feb 2015 09:11:55 +0100 Subject: Add BanditCpp 1.1.4 test harness --- vendor/bandit/specs/synopsis.spec.cpp | 54 +++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 vendor/bandit/specs/synopsis.spec.cpp (limited to 'vendor/bandit/specs/synopsis.spec.cpp') diff --git a/vendor/bandit/specs/synopsis.spec.cpp b/vendor/bandit/specs/synopsis.spec.cpp new file mode 100644 index 00000000..3b717f75 --- /dev/null +++ b/vendor/bandit/specs/synopsis.spec.cpp @@ -0,0 +1,54 @@ +#include + +go_bandit([](){ + describe("my first spec", [&]() { + int a; + + before_each([&](){ + a = 99; + }); + + it("should be initialized", [&](){ + AssertThat(a, Equals(99)); + a = 102; + }); + + describe("nested spec", [&](){ + + before_each([&](){ + a += 3; + }); + + it("should build on outer spec", [&](){ + AssertThat(a, Equals(102)); + a = 666; + }); + + it("should build on outer spec yet again", [&](){ + AssertThat(a, Equals(102)); + a = 667; + }); + + }); + + it("should be initialized before each it", [&](){ + AssertThat(a, Equals(99)); + }); + }); + + describe("my second spec", [&](){ + int b; + + before_each([&](){ + b = 22; + }); + + before_each([&](){ + b += 3; + }); + + it("should be 25", [&](){ + AssertThat(b, Equals(25)); + }); + }); +}); -- cgit v1.2.3