sproutcore/sproutcore — comment on commit e6e5283b37d2868ae6f6fe32cd043a41c85e5895
File:  line 0
By publickeating:

Hi. This should have included some simple unit tests for acceptance. Like it should at least do a quick sanity check that the address, type and body are properly set on the returned object. I know it’s obvious, but you never know when someone might rewrite these in the future. Perhaps introducing a copy/paste mistake like so:

getUrl: function(address) {
return this.request(address, null, ‘GET’) ;
},

postUrl: function(address, body) {
return this.request(address, body, ‘POST’) ;
},

deleteUrl: function(address) {
return this.request(address, null, ‘DELETE’) ;
},

putUrl: function(address, body) {
return this.request(address, body, ‘PUT’) ;
},

patchUrl: function(address, body) {
return this.request(address, body, ‘PUT’) ;
},

request: function(address, body, type) {
var req = this.create().set('address', address).set('type', type);
if(body) { req.set('body', body) ; }
return req ;
}

Or someone might remove them in the future without properly deprecating, so a failing unit test would become a warning flag. Food for thought. Thanks.