Monthly Archive: December 2016

sinonjs 0

Attempted to wrap undefined property as function

The poten­tial prob­lem could be that your meth­ods are dynamically-created meth­ods through Object.prototype. If that’s the case then, you can try the fol­low­ing : sinon.stub(FUT.prototype, “Foo”).returns(true); FUT — Func­tion Under Test

sinonjs 0

Cannot stub non-existent own property

The poten­tial prob­lem could be that sinon does not mock objects with dynamically-created meth­ods through Object.prototype. To mit­i­gate such prob­lem, you can try the fol­low­ing : var sinon = require(‘sinon’); var sand­box = sinon.sandbox.create();…

ruby-on-rails-min 0

How to run only one test in rspec

Mostly while devel­op­ing its extremely con­ve­nient to be able to run just one par­tic­u­lar describe block or it block. Rspec lets you do that using a com­bi­na­tion of focus: true as well as adding some…