<p>Here's my issue, I'd like to mock a class that creates a thread at initialization and closes it at destruction.  There's no reason for my mock class to actually create and close threads.  But, to mock a class, I have inherit from it.  When I create a new instance of my mock class, the base classes constructor is called, creating the thread.  When my mock object is destroyed, the base classes destructor is called, attempting to close the thread.  </p>

<p>How does one mock an RAII class without having to deal with the actual resource?</p>

You instead make an interface that describes the type, and have both the real class and the mock class inherit from that. So if you had:
```
```
class RAIIClass {
 public:
  RAIIClass(Foo* f);
  ~RAIIClass();
  bool DoOperation();

 private:
  ...
};
```
```
You would make an interface like:
```
```
class MockableInterface {
 public:
  MockableInterface(Foo* f);
  virtual ~MockableInterface();
  virtual bool DoOperation() = 0;
};
```
```
And go from there.