Skip to content

Commit

Permalink
Merge pull request cheeriojs#552 from jugglinmike/load-function
Browse files Browse the repository at this point in the history
Return a fully-qualified Function from `$.load`
  • Loading branch information
davidchambers committed Aug 19, 2014
2 parents 0a36bb8 + 2149728 commit f8c5497
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/static.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ exports.load = function(content, options) {
initialize.prototype = Cheerio.prototype;

// Add in the static methods
initialize.__proto__ = exports;
_.merge(initialize, exports);

// Add in the root
initialize._root = root;
Expand Down
6 changes: 6 additions & 0 deletions test/cheerio.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,5 +284,11 @@ describe('cheerio', function() {
expect(domEncoded('footer').html()).to.be(expectedXml);
});

it('should return a fully-qualified Function', function() {
var $c = $.load('<div>');

expect($c).to.be.a(Function);
});

});
});

0 comments on commit f8c5497

Please sign in to comment.