[ospec] make o.only noisier

This commit is contained in:
Pierre-Yves Gerardy 2017-02-11 22:25:10 +01:00
parent 6dd9394fef
commit 9b3e646303
2 changed files with 5 additions and 2 deletions

View file

@ -18,7 +18,10 @@ module.exports = new function init() {
predicate()
ctx = parent
}
o.only = function(subject, predicate) {o(subject, only = predicate)}
o.only = function(subject, predicate, silent) {
if (!silent) console.log(highlight("/!\\ WARNING /!\\ o.only() mode"))
o(subject, only = predicate)
}
o.spy = function(fn) {
var spy = function() {
spy.this = this

View file

@ -12,7 +12,7 @@ new function(o) {
})
o.only(".only()", function() {
o(2).equals(2)
})
}, true)
})
o.run()