Permalink
Browse files

fixed outer html bug

  • Loading branch information...
1 parent 2b77294 commit 2b7500d707a7ca8411953aca10556b7f5180658b @matthewmueller matthewmueller committed Nov 18, 2012
Showing with 6 additions and 1 deletion.
  1. +1 −1 lib/static.js
  2. +5 −0 test/api.utils.js
View
2 lib/static.js
@@ -34,7 +34,7 @@ var load = exports.load = function(str, options) {
var html = exports.html = function(dom) {
if (dom) {
- dom = (typeof dom === 'string') ? select(selector, this._root) : dom;
+ dom = (typeof dom === 'string') ? select(dom, this._root) : dom;
return render(dom);
} else if (this._root && this._root.children) {
return render(this._root.children);
View
5 test/api.utils.js
@@ -1,4 +1,5 @@
var expect = require('expect.js'),
+ fixtures = require('./fixtures'),
$ = require('../');
@@ -28,6 +29,10 @@ describe('$', function() {
expect($().html()).to.be(null);
});
+ it('(selector) : should return the outerHTML of the selected element', function() {
+ var _$ = $.load(fixtures.fruits);
+ expect(_$.html('.pear')).to.equal('<li class="pear">Pear</li>');
+ });
});

0 comments on commit 2b7500d

Please sign in to comment.