{"action":"opened","issue":{"url":"https://api.github.com/repos/rspec/rspec-mocks/issues/909","labels_url":"https://api.github.com/repos/rspec/rspec-mocks/issues/909/labels{/name}","comments_url":"https://api.github.com/repos/rspec/rspec-mocks/issues/909/comments","events_url":"https://api.github.com/repos/rspec/rspec-mocks/issues/909/events","html_url":"https://github.com/rspec/rspec-mocks/issues/909","id":60637130,"number":909,"title":"[FEATURE] Default name for doubles","user":{"login":"mariogintili","id":3522106,"avatar_url":"https://avatars.githubusercontent.com/u/3522106?v=3","gravatar_id":"","url":"https://api.github.com/users/mariogintili","html_url":"https://github.com/mariogintili","followers_url":"https://api.github.com/users/mariogintili/followers","following_url":"https://api.github.com/users/mariogintili/following{/other_user}","gists_url":"https://api.github.com/users/mariogintili/gists{/gist_id}","starred_url":"https://api.github.com/users/mariogintili/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mariogintili/subscriptions","organizations_url":"https://api.github.com/users/mariogintili/orgs","repos_url":"https://api.github.com/users/mariogintili/repos","events_url":"https://api.github.com/users/mariogintili/events{/privacy}","received_events_url":"https://api.github.com/users/mariogintili/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-03-11T10:22:20Z","updated_at":"2015-03-11T10:22:20Z","closed_at":null,"body":"Hello guys,\r\n\r\nI've found hard to debug tests that have +1 unnamed double. Like\r\n\r\n```ruby\r\nRSpec.describe \"So many dubs\" do\r\n\r\n  let(:camel) { double }\r\n  let(:lion) { double }\r\n  let(:another_double) { double }\r\n\r\n  it 'does not name a doubles' do\r\n     lion.eat(camel)\r\n     expect(camel).to be_eaten\r\n     expect(lion).to be_full\r\n  end\r\nend\r\n```\r\n\r\n```\r\nF\r\n\r\nFailures:\r\n\r\n  1) So many dubs does not name a doubles\r\n     Failure/Error: lion.eat(camel)\r\n       Double received unexpected message :eat with (#<RSpec::Mocks::Mock:0x89a2540c @name=nil>)\r\n     # ./spec/dumb_test_spec.rb:10:in `block (2 levels) in <top (required)>'\r\n\r\nFinished in 0.01773 seconds\r\n1 example, 1 failure\r\n\r\nFailed examples:\r\n\r\nrspec ./spec/dumb_test_spec.rb:9 # So many dubs does not name a doubles\r\n```\r\n\r\nBecause mocks are unnamed, however they are  being assigned through a symbol, that could also be their name rather than nothing. Seems like something quite vanilla to implement and will add a lot of value, what do you guys think?"}}