summaryrefslogtreecommitdiff
path: root/vendor/bandit/specs/synopsis.spec.cpp
diff options
context:
space:
mode:
authorManoj Srivastava <srivasta@debian.org>2016-01-27 12:43:59 -0800
committerManoj Srivastava <srivasta@debian.org>2016-01-27 12:50:09 -0800
commit76fce162659078323fcd5e54b3195dae371faca2 (patch)
treec1d93d415b96238aae3c54eb83cb0815af2e4bca /vendor/bandit/specs/synopsis.spec.cpp
parentb4456969cd02d75c599a5b86b225c0774697e85d (diff)
parent4aa1a39402c3908e9e8b6eb3fd4e2183d5e5c52e (diff)
Merge branch 'development' into upstream
Signed-off-by: Manoj Srivastava <srivasta@debian.org> # Conflicts: # src/.gitignore # src/maid-x11.c # src/quest.pkg
Diffstat (limited to 'vendor/bandit/specs/synopsis.spec.cpp')
-rw-r--r--vendor/bandit/specs/synopsis.spec.cpp54
1 files changed, 54 insertions, 0 deletions
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 <specs/specs.h>
+
+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));
+ });
+ });
+});