The `lambda` and `instance_exec` above for it feel kinda hacky.  Instead, I would recommend this:

``` ruby
it_behaves_like "A stub/mock in a before(:all) block" do
  def use_rspec_mocks
    Object.stub(:foo)
  end
end
```

In the `before(:all)` block above you can just call `use_rspec_mocks` (rather than the `instance_exec` business).