function spyOnlyCallsWithArgs(obj, method) {
  var originalFn = obj[method];
  var spy = spyOn(obj, method);
  obj[method] = function() {
    if (arguments.length) return spy.apply(this, arguments);
    return originalFn.apply(this);
  };
  return spy;
}
Create jasmine.Spy on given method, but ignore calls without arguments
This is helpful when need to spy only setter methods and ignore getters