From 7b9f4e4e8169ca2fad3a1c7ca03f07ecfc46678e Mon Sep 17 00:00:00 2001 From: Bardur Arantsson Date: Sat, 1 Aug 2015 16:35:25 +0200 Subject: Bandit 2.0.0 --- .../assertion_frameworks/matchers/BeGreaterThan.h | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 vendor/bandit/bandit/assertion_frameworks/matchers/BeGreaterThan.h (limited to 'vendor/bandit/bandit/assertion_frameworks/matchers/BeGreaterThan.h') diff --git a/vendor/bandit/bandit/assertion_frameworks/matchers/BeGreaterThan.h b/vendor/bandit/bandit/assertion_frameworks/matchers/BeGreaterThan.h new file mode 100644 index 00000000..95d93d1e --- /dev/null +++ b/vendor/bandit/bandit/assertion_frameworks/matchers/BeGreaterThan.h @@ -0,0 +1,39 @@ +#ifndef BANDIT_BEGREATERTHAN_H +#define BANDIT_BEGREATERTHAN_H + +#include "Matcher.h" + +namespace bandit { namespace Matchers { + + template + class BeGreaterThan : public Matcher + { + public: + explicit BeGreaterThan(const T& expectedValue) : Matcher(), _expectedValue(expectedValue) {} + + template + bool matches(const U& actualValue) const + { + return actualValue > _expectedValue; + } + + protected: + virtual std::string failure_message_end() const + { + std::ostringstream ss; + ss << "be greater than <" << _expectedValue << ">"; + return ss.str(); + } + + private: + const T& _expectedValue; + }; + + template + BeGreaterThan be_greater_than(const T& expectedValue) + { + return BeGreaterThan(expectedValue); + } +}} + +#endif // BANDIT_BEGREATERTHAN_H -- cgit v1.2.3