');
      expect(root.append('text')).toEqual(root);
      expect(root.html()).toEqual('text');
    });
    it('should not append anything if parent node is not of type element', function() {
      var root = jqLite(document.createDocumentFragment());
      expect(root.append('
')).toBe(root);
      expect(root.children().length).toBe(0);
    });
  });
  describe('prepend', function() {
    it('should prepend to empty', function() {
      var root = jqLite('
');
      expect(root.prepend('
abc')).toEqual(root);
      expect(root.html().toLowerCase()).toEqual('
abc');
    });
    it('should prepend to content', function() {
      var root = jqLite('
text
');
      expect(root.prepend('
abc')).toEqual(root);
      expect(root.html().toLowerCase()).toEqual('
abctext');
    });
    it('should prepend text to content', function() {
      var root = jqLite('
text
');
      expect(root.prepend('abc')).toEqual(root);
      expect(root.html().toLowerCase()).toEqual('abctext');
    });
  });
  describe('remove', function() {
    it('should remove', function() {
      var root = jqLite('
abc
');
      var span = root.find('span');
      expect(span.remove()).toEqual(span);
      expect(root.html()).toEqual('');
    });
  });
  describe('after', function() {
    it('should after', function() {
      var root = jqLite('
');
      var span = root.find('span');
      expect(span.after('
')).toEqual(span);
      expect(root.html().toLowerCase()).toEqual('
');
    });
    it('should allow taking text', function() {
      var root = jqLite('
');
      var span = root.find('span');
      span.after('abc');
      expect(root.html().toLowerCase()).toEqual('
abc');
    });
  });
  describe('parent', function() {
    it('should return parent or an empty set when no parent', function() {
      var parent = jqLite('
'),
          child = parent.find('p');
      expect(parent.parent()).toBeTruthy();
      expect(parent.parent().length).toEqual(0);
      expect(child.parent().length).toBe(1);
      expect(child.parent()[0]).toBe(parent[0]);
    });
    it('should return empty set when no parent', function() {
      var element = jqLite('
abc
');
      expect(element.parent()).toBeTruthy();
      expect(element.parent().length).toEqual(0);
    });
    it('should return empty jqLite object when parent is a document fragment', function() {
      //this is quite unfortunate but jQuery 1.5.1 behaves this way
      var fragment = document.createDocumentFragment(),
          child = jqLite('
foo
');
      fragment.appendChild(child[0]);
      expect(child[0].parentNode).toBe(fragment);
      expect(child.parent().length).toBe(0);
    });
  });
  describe('next', function() {
    it('should return next sibling', function() {
      var element = jqLite('
bi
');
      var b = element.find('b');
      var i = element.find('i');
      expect(b.next()).toJqEqual([i]);
    });
  });
  describe('find', function() {
    it('should find child by name', function() {
      var root = jqLite('
');
      var innerDiv = root.find('div');
      expect(innerDiv.length).toEqual(1);
      expect(innerDiv.html()).toEqual('text');
    });
  });
  describe('eq', function() {
    it('should select the nth element ', function() {
      var element = jqLite('
aa
bb
');
      expect(element.find('span').eq(0).html()).toBe('aa');
      expect(element.find('span').eq(-1).html()).toBe('bb');
      expect(element.find('span').eq(20).length).toBe(0);
    });
  });
  describe('camelCase', function() {
   it('should leave non-dashed strings alone', function() {
     expect(camelCase('foo')).toBe('foo');
     expect(camelCase('')).toBe('');
     expect(camelCase('fooBar')).toBe('fooBar');
   });
   it('should covert dash-separated strings to camelCase', function() {
     expect(camelCase('foo-bar')).toBe('fooBar');
     expect(camelCase('foo-bar-baz')).toBe('fooBarBaz');
   });
   it('should covert browser specific css properties', function() {
     expect(camelCase('-moz-foo-bar')).toBe('MozFooBar');
     expect(camelCase('-webkit-foo-bar')).toBe('webkitFooBar');
     expect(camelCase('-webkit-foo-bar')).toBe('webkitFooBar');
   })
  });
});