Skip to content

Commit

Permalink
Step 4: make the first test pass
Browse files Browse the repository at this point in the history
This is not proper Kent Beckian triangulation, because 
I threw the if() statement in there before it was properly
required by the test. In practice I'll probably comment out
the branch with and without the tests to ensure it's being
demanded properly, which is hard to capture in a git log
  • Loading branch information
searls committed Dec 23, 2017
1 parent 66389cb commit d9d30f9
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions src/verify/index.js
@@ -1,9 +1,17 @@
import CallLog from '../value/call-log'

import ensureDemonstration from './ensure-demonstration'
import didCallOccur from './did-call-occur'
import notifySatisfiedMatchers from './notify-satisfied-matchers'
import warnIfAlsoStubbed from './warn-if-also-stubbed'

export default function verify (__userInvokesDemonstrationHere__, config) {
// 1. double, call = CallLog.instance.pop
// 2. ensureDemonstration(call)
// 3. if call-occurred (double, call, config)
// a. notify-satisfied-matchers(double, call, config)
// b. warn-if-also-stubbed (double, call)
const {double, call} = CallLog.instance.pop()
ensureDemonstration(call)
if (didCallOccur(double, call, config)) {
notifySatisfiedMatchers(double, call, config)
warnIfAlsoStubbed(double, call, config)
}
// 4. else
// a. fail-verification (double, call, config)
}

0 comments on commit d9d30f9

Please sign in to comment.