Sha256: 6b4dc47620f87d4770a35a18d8a62cf11f6d01fc66e7efaa95b123cbec8a80a3

Contents?: true

Size: 1.2 KB

Versions: 1

Compression:

Stored size: 1.2 KB

Contents

describe('re', function(){
  
  re.e('queryre')
  
  it('should query', function(){
    eq(re('queryre').length, 1)
  })
  
  it('should get element by id', function(){
    setup_canvas()
    
    is(re.$('#game-canvas'))
    is(re.$('#game-canvas'))
    is(re.$('#game-canvas'))
    
    teardown_canvas()
  })
  
  it('should get element by tag', function(){
    setup_canvas()
    
    is(re.$('canvas'))
    is(re.$('canvas'))
    is(re.$('canvas'))
    
    teardown_canvas()
  })
  
  it('should create element', function(){
    is(re.$new('canvas'), 'htmlcanvaselement')
  })
  
  it('should re.is work', function(){
    ok(re.is({}))
    ok(re.is(1))
    ok(re.is(1, 'Number'))
    
    not(re.is(null))
    not(re.is(undefined))
    
    not(re.is(null, 'array'))
    not(re.is(1, 'string'))
    not(re.is('', 'number'))
    not(re.is('', 'Number'))
    
    ok(re.is('', 'string'))
    ok(re.is(1, 'number'))
    ok(re.is([], 'array'))
    ok(re.is(/sd/, 'regexp'))
    ok(re.is(re.$new('canvas'), 'htmlcanvaselement'))
    var k = {};
    ok(re.is(k, 'object'))
    var f = function(){};
    ok(re.is(f, 'function'))
  })
  
  it('should define indexof', function(){
    is(Array.prototype.indexOf, 'function')
  })
  
})

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
entityjs-0.3.0 spec/javascripts/src/core/re_spec.js