Skip to content

Instantly share code, notes, and snippets.

@reharik
Last active November 20, 2015 03:16
Show Gist options
  • Save reharik/6d98a4afa35a615e5d2a to your computer and use it in GitHub Desktop.
Save reharik/6d98a4afa35a615e5d2a to your computer and use it in GitHub Desktop.
return function(event, handelr){
var Future = _fantasy.Future;
//checkIfProcessed:: JSON -> Future<string|JSON>
var checkIfProcessed = i => Future((rej,ret) => i.isIdempotent ? ret(i) : rej('item has already been processed'));
//checkIdempotence JSON -> Future<string|JSON>
var checkIdempotency = R.curry((x,y) => R.compose(R.map(checkIfProcessed), readstorerepository.checkIdempotency(y)));
return {
checkIfProcessed,
checkIdempotency
}
}
this one works
describe('#CHECKIFPROCESSED', function() {
context('when calling with isIdepotence equal to true', function () {
it('should return the data', function () {
mut.checkIfProcessed({isIdempotent:true}).fork(null,x=> x.must.eql({isIdempotent:true}));
})
});
});
obviously the below is in a state of confusion
describe('#CHECKIFPROCESSED', function() {
context('when calling with isIdepotence equal to true', function () {
it('should return the data', function () {
mut.checkIfProcessed({isIdempotent:true}).fork(null, ).must.eql(Future({isIdempotent:true}));
})
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment