Have you considered extracting this temporary replacement of `$stderr` into a helper method? I'm thinking something along the lines of the following.
```ruby
def with_stubbed_stderr(&block)
  begin
    orig_stderr = $stderr
    $stderr = StringIO.new
    yield(block)
  ensure
    $stderr = orig_stderr
  end
end

with_stubbed_stderr do
  empty_args = []
  expect { CLI.new(args: empty_args).run }.to terminate.with_code(1)
  expect($stderr.string).to have_error_message('RuntimeError')
end
```