I have this function in my source file:
function gimmeANumber(){
var x = 4;
return x;
}
And a spec borrowed from this tutorial
describe('Hello world', function() {
beforeEach(function() {
this.addMatchers({
toBeDivisibleByTwo: function() {
return (this.actual % 2) === 0;
}
});
});
it('is divisible by 2', function() {
expect(gimmeANumber()).toBeDivisibleByTwo();
});
});
This is the error:
TypeError: undefined is not a function at Object. (file:///home/n/foo/jasmine/jasmine-2.0.0/dist/spec/HelloWorldSpec.js...) Thank you.