freerange/mocha — pull request #101 by urbanautomaton (2012-09-04 18:43:41+00:00)
Title: Mock#respond_to? doesn't work with a string argument

Hi,

I ran into the following behaviour today, where a mocha mock will answer `#respond_to?` correctly when passed a symbol, but not when passed a string:

```ruby
require 'rspec'
require 'mocha'

RSpec.configure do |config|
config.mock_with :mocha
end

describe "#respond_to? issue" do
subject { stub(:gentle_persuasion => :the_truth) }

# passes
it "responds correctly to symbol call" do
subject.should respond_to :gentle_persuasion
end

# fails
it "responds correctly to string call" do
subject.should respond_to 'gentle_persuasion'
end
end
```

I believe the second assertion should pass too, to match `Object#respond_to?`'s usual behaviour. A patch and tests are attached - give me shout if there's anything you'd like done differently...

Cheers,
Simon