Read more

Jasmine: Test that an object is an instance of a given class

Henning Koch
January 29, 2020Software engineer at makandra GmbH

To test that an object was constructed by a given constructor function, use jasmine.any(Klass):

describe('plus()', function() {
  it ('returns a number', function() {
    let result = plus(1, 2)
    expect(result).toEqual(jasmine.any(Number))
  })
})
Illustration online protection

Rails Long Term Support

Rails LTS provides security patches for old versions of Ruby on Rails (2.3, 3.2, 4.2 and 5.2)

  • Prevents you from data breaches and liability risks
  • Upgrade at your own pace
  • Works with modern Rubies
Read more Show archive.org snapshot

Also see Expecting objects as method invocation arguments.

Posted by Henning Koch to makandra dev (2020-01-29 10:19)