{"action":"created","issue":{"url":"https://api.github.com/repos/cjohansen/Sinon.JS/issues/692","labels_url":"https://api.github.com/repos/cjohansen/Sinon.JS/issues/692/labels{/name}","comments_url":"https://api.github.com/repos/cjohansen/Sinon.JS/issues/692/comments","events_url":"https://api.github.com/repos/cjohansen/Sinon.JS/issues/692/events","html_url":"https://github.com/cjohansen/Sinon.JS/pull/692","id":59062238,"number":692,"title":"Feature: getters & setters","user":{"login":"simonzack","id":628500,"avatar_url":"https://avatars.githubusercontent.com/u/628500?v=3","gravatar_id":"","url":"https://api.github.com/users/simonzack","html_url":"https://github.com/simonzack","followers_url":"https://api.github.com/users/simonzack/followers","following_url":"https://api.github.com/users/simonzack/following{/other_user}","gists_url":"https://api.github.com/users/simonzack/gists{/gist_id}","starred_url":"https://api.github.com/users/simonzack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simonzack/subscriptions","organizations_url":"https://api.github.com/users/simonzack/orgs","repos_url":"https://api.github.com/users/simonzack/repos","events_url":"https://api.github.com/users/simonzack/events{/privacy}","received_events_url":"https://api.github.com/users/simonzack/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-02-26T12:00:53Z","updated_at":"2015-03-04T20:14:48Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/cjohansen/Sinon.JS/pulls/692","html_url":"https://github.com/cjohansen/Sinon.JS/pull/692","diff_url":"https://github.com/cjohansen/Sinon.JS/pull/692.diff","patch_url":"https://github.com/cjohansen/Sinon.JS/pull/692.patch"},"body":"This PR addresses #88. I didn't touch mock as I've read about the plans to remove it in 2.0.\r\n\r\nI've tried to make as little modification to the existing codebase as possible, and integrated getters & setters by providing an additional `type` parameter, which can take the value `get` or `set`. Using `defineProperty` and friends also solves #690.\r\n\r\nExample usage:\r\n\r\n    var obj = {};\r\n    Object.defineProperty(obj, 'property', {\r\n      get: function(){\r\n        return 1;\r\n      },\r\n      configurable: true\r\n    });\r\n    var stub = sinon.stub(obj, 'get', 'property', function(){return 2;});\r\n    console.log(obj.property);\r\n    stub.restore();\r\n\r\n@cjohansen I understand that you're not really a fan of getters & setters, but a lot of people do have a need for this (see above issue). Since sinon is the best (and only) mocking framework around, I think that getter & setter support will really benefit the community."},"comment":{"url":"https://api.github.com/repos/cjohansen/Sinon.JS/issues/comments/77236921","html_url":"https://github.com/cjohansen/Sinon.JS/pull/692#issuecomment-77236921","issue_url":"https://api.github.com/repos/cjohansen/Sinon.JS/issues/692","id":77236921,"user":{"login":"simonzack","id":628500,"avatar_url":"https://avatars.githubusercontent.com/u/628500?v=3","gravatar_id":"","url":"https://api.github.com/users/simonzack","html_url":"https://github.com/simonzack","followers_url":"https://api.github.com/users/simonzack/followers","following_url":"https://api.github.com/users/simonzack/following{/other_user}","gists_url":"https://api.github.com/users/simonzack/gists{/gist_id}","starred_url":"https://api.github.com/users/simonzack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simonzack/subscriptions","organizations_url":"https://api.github.com/users/simonzack/orgs","repos_url":"https://api.github.com/users/simonzack/repos","events_url":"https://api.github.com/users/simonzack/events{/privacy}","received_events_url":"https://api.github.com/users/simonzack/received_events","type":"User","site_admin":false},"created_at":"2015-03-04T20:14:48Z","updated_at":"2015-03-04T20:14:48Z","body":"@cjohansen Could you run the build again? Only 0.10 is failing and it says \"this potentially indicates a stalled build\", could be a travis issue."}}