{"action":"created","issue":{"url":"https://api.github.com/repos/avdi/naught/issues/65","labels_url":"https://api.github.com/repos/avdi/naught/issues/65/labels{/name}","comments_url":"https://api.github.com/repos/avdi/naught/issues/65/comments","events_url":"https://api.github.com/repos/avdi/naught/issues/65/events","html_url":"https://github.com/avdi/naught/issues/65","id":55079470,"number":65,"title":"In JRuby: Mimic'd Object with \"send\" Method Uses Ruby's Object#send","user":{"login":"sbellware","id":695,"avatar_url":"https://avatars.githubusercontent.com/u/695?v=3","gravatar_id":"","url":"https://api.github.com/users/sbellware","html_url":"https://github.com/sbellware","followers_url":"https://api.github.com/users/sbellware/followers","following_url":"https://api.github.com/users/sbellware/following{/other_user}","gists_url":"https://api.github.com/users/sbellware/gists{/gist_id}","starred_url":"https://api.github.com/users/sbellware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbellware/subscriptions","organizations_url":"https://api.github.com/users/sbellware/orgs","repos_url":"https://api.github.com/users/sbellware/repos","events_url":"https://api.github.com/users/sbellware/events{/privacy}","received_events_url":"https://api.github.com/users/sbellware/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-01-21T21:27:00Z","updated_at":"2015-01-22T12:59:36Z","closed_at":null,"body":"Note: Problem found in JRuby 1.7.18. The problem doesn't occur in MRI 2.1.0.\r\n\r\nCondition: A class has a method named \"send\", and a null object with mimic configured is created from that class\r\n\r\nAction: Call the \"send\" method on the null object.\r\n\r\nResult: Ruby's Object#send is invoked\r\n\r\nFor example...\r\n```ruby\r\nclass MessageBus\r\n  def send(msg)\r\n  end\r\nend\r\n\r\nNullObject = Naught.build do |config|\r\n  config.mimic MessageBus\r\nend\r\n\r\nn = NullObject.new\r\nn.send 'some message'\r\n\r\n# => NoMethodError: undefined method `some message' for <null:MessageBus>:NullObject\r\n```\r\nIf the definition of the \"send\" method is added to the null object configuration, the problem doesn't occur:\r\n```ruby\r\nNullObject = Naught.build do |config|\r\n  config.mimic MessageBus\r\n\r\n  def send(msg)\r\n  end\r\nend\r\n\r\nn = NullObject.new\r\nn.send 'some message'\r\n# ok, no error\r\n```"},"comment":{"url":"https://api.github.com/repos/avdi/naught/issues/comments/71016582","html_url":"https://github.com/avdi/naught/issues/65#issuecomment-71016582","issue_url":"https://api.github.com/repos/avdi/naught/issues/65","id":71016582,"user":{"login":"sferik","id":10308,"avatar_url":"https://avatars.githubusercontent.com/u/10308?v=3","gravatar_id":"","url":"https://api.github.com/users/sferik","html_url":"https://github.com/sferik","followers_url":"https://api.github.com/users/sferik/followers","following_url":"https://api.github.com/users/sferik/following{/other_user}","gists_url":"https://api.github.com/users/sferik/gists{/gist_id}","starred_url":"https://api.github.com/users/sferik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sferik/subscriptions","organizations_url":"https://api.github.com/users/sferik/orgs","repos_url":"https://api.github.com/users/sferik/repos","events_url":"https://api.github.com/users/sferik/events{/privacy}","received_events_url":"https://api.github.com/users/sferik/received_events","type":"User","site_admin":false},"created_at":"2015-01-22T12:59:36Z","updated_at":"2015-01-22T12:59:36Z","body":"If an error occurs in JRuby but not MRI, that sounds like an issue to be raised with the JRuby project, not Naught. /cc @headius @enebo"}}