Turning my comment into an answer...
There's a little hack you can use. Define a derived class like so:
class B : public A {
public:
MOCK_METHOD0(isTrue, bool());
using A::doSomething;
};
This obviously only works if isTrue
is virtual
.
Beware: Check your company's testing guidelines regarding "code made especially for testing" instead of testing the real code. In your situation (legacy codebase) this might be okay.