Sha256: c2fcd99b754652abfc8c23d0be603dc6cde01de67e2040f7b5219d2dd60e8b18

Contents?: true

Size: 931 Bytes

Versions: 1

Compression:

Stored size: 931 Bytes

Contents

function is(obj, type){
  if(arguments.length == 1){
    expect(obj).toNotBe(null)
    expect(obj).toNotBe(undefined)
  } else{
    ok(obj != null && Object.prototype.toString.call(obj).slice(8, -1).toLowerCase() == type.toLowerCase())
  }
}

function eq(test, value){
  expect(test).toEqual(value)
}

function neq(test, value){
  expect(test).not.toEqual(value)
}

function ok(test){
  expect(test).toBeTruthy()
}

function not(test){
  expect(test).toBeFalsy()
}

function be(test, type){
  expect(test).toBe(type)
}

function beNull(test){
  expect(test).toBeNull()
}

function match(test, reg, i){
  if(typeof reg == 'string'){
    reg = new RegExp(reg, i)
  }
  expect(test).toMatch(reg)
  
}

function called(value){
  if(arguments.length == 1){
    expect(value).toHaveBeenCalled()
  } else {
    var a = Array.prototype.slice.apply(arguments, 1)
    var con = expect(value)
    con.toHaveBeenCalledWith.apply(con, a)
  }
}

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
entityjs-0.3.0 spec/javascripts/helpers/entityunit.js