I'm not a fan of chaining on multiple lines... so I would look to do something like this to improve readability:
```
arguments = [described_class.rpm_cmd, :params => {"-qi" => "ruby"}]
result = CommandResult.new("", data, "", 0)

described_class.should_receive(:run).with(arguments).and_return(result)
```