Merge pull request #1617 from pygy/warn-only

[ospec] Make some moise when `o.only()` is called
This commit is contained in:
Leo Horie 2017-02-12 00:32:18 -05:00 committed by GitHub
commit 08236e7505
2 changed files with 5 additions and 2 deletions

View file

@ -18,7 +18,10 @@ module.exports = new function init() {
predicate() predicate()
ctx = parent 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) { o.spy = function(fn) {
var spy = function() { var spy = function() {
spy.this = this spy.this = this

View file

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