summaryrefslogtreecommitdiff
path: root/vendor/bandit/specs/options.spec.cpp
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2015-08-01 16:35:25 +0200
committerBardur Arantsson <bardur@scientician.net>2015-09-14 05:58:27 +0200
commit7b9f4e4e8169ca2fad3a1c7ca03f07ecfc46678e (patch)
tree0cef1ac0dc228b621afc90bc94e4e0dddcb90c82 /vendor/bandit/specs/options.spec.cpp
parentc6196b25d119a10e79deedef26a73e0d5a021b0e (diff)
Bandit 2.0.0
Diffstat (limited to 'vendor/bandit/specs/options.spec.cpp')
-rw-r--r--vendor/bandit/specs/options.spec.cpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/vendor/bandit/specs/options.spec.cpp b/vendor/bandit/specs/options.spec.cpp
index 02e2818c..74d057ec 100644
--- a/vendor/bandit/specs/options.spec.cpp
+++ b/vendor/bandit/specs/options.spec.cpp
@@ -6,7 +6,7 @@ namespace bd = bandit::detail;
go_bandit([](){
describe("options:", [&](){
-
+
it("parses the '--help' option", [&](){
const char* args[] = {"executable", "--help"};
argv_helper argv(2, args);
@@ -82,12 +82,20 @@ go_bandit([](){
AssertThat(opt.only(), Equals(""));
});
+ it("parses the '--break-on-failure' oprtion", [&](){
+ const char* args[] = {"executable", "--break-on-failure"};
+ argv_helper argv(2, args);
+
+ bd::options opt(argv.argc(), argv.argv());
+
+ AssertThat(opt.break_on_failure(), IsTrue());
+ });
+
describe("with no arguments", [&](){
const char* args[] = {"executable"};
argv_helper argv(1, args);
bd::options opt(argv.argc(), argv.argv());
-
it("cannot find '--help'", [&](){
AssertThat(opt.help(), IsFalse());
});
@@ -95,11 +103,15 @@ go_bandit([](){
it("cannot find '--version'", [&](){
AssertThat(opt.version(), IsFalse());
});
-
+
it("cannot find '--no-color'", [&](){
AssertThat(opt.no_color(), IsFalse());
});
+ it("cannot fine '--break-on-failure'", [&](){
+ AssertThat(opt.break_on_failure(), IsFalse())
+ });
+
it("uses default formatter for '--formatter'", [&](){
AssertThat(opt.formatter(), Equals(bd::options::formatters::FORMATTER_DEFAULT));
});