diff options
author | Bardur Arantsson <bardur@scientician.net> | 2015-02-23 09:11:55 +0100 |
---|---|---|
committer | Bardur Arantsson <bardur@scientician.net> | 2015-02-23 09:11:55 +0100 |
commit | 062cd07342edc2b003555e90dd2cee0514b9f64a (patch) | |
tree | 3c73893dae8a9380c9f24e9c5822c5ec6bf671d5 /vendor/bandit/specs/failure_formatters/default_formatter.spec.cpp | |
parent | ffee481435ac0afe3f9a5a3eb07b2f2a46467089 (diff) |
Add BanditCpp 1.1.4 test harness
Diffstat (limited to 'vendor/bandit/specs/failure_formatters/default_formatter.spec.cpp')
-rw-r--r-- | vendor/bandit/specs/failure_formatters/default_formatter.spec.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/vendor/bandit/specs/failure_formatters/default_formatter.spec.cpp b/vendor/bandit/specs/failure_formatters/default_formatter.spec.cpp new file mode 100644 index 00000000..6d29b694 --- /dev/null +++ b/vendor/bandit/specs/failure_formatters/default_formatter.spec.cpp @@ -0,0 +1,21 @@ +#include <specs/specs.h> +namespace bd = bandit::detail; + +go_bandit([](){ + + describe("default failure formatter", [&](){ + bd::default_failure_formatter formatter; + + it("formats assertions with file and line number", [&](){ + bd::assertion_exception exception("message", "file", 321); + AssertThat(formatter.format(exception), Equals("file:321: message")); + }); + + it("formats assertions without file and line number", [&](){ + bd::assertion_exception exception("message"); + AssertThat(formatter.format(exception), Equals("message")); + }); + + }); + +}); |