moved the widget tests back under an immediate function

This commit is contained in:
John Bender 2011-03-19 23:12:55 -07:00
parent 3316e559b3
commit ff23f63881

View file

@ -1,32 +1,33 @@
/*
* mobile widget unit tests
*/
(function($){
module('jquery.mobile.widget.js');
module('jquery.mobile.widget.js');
test( "getting data from creation options", function(){
var expected = "bizzle";
test( "getting data from creation options", function(){
var expected = "bizzle";
$.mobile.widget.prototype.options = { "fooBar" : true };
$.mobile.widget.prototype.element = $("<div data-foo-bar=" + expected + ">");
same($.mobile.widget.prototype._getCreateOptions()["fooBar"],
expected);
});
$.mobile.widget.prototype.options = { "fooBar" : true };
$.mobile.widget.prototype.element = $("<div data-foo-bar=" + expected + ">");
same($.mobile.widget.prototype._getCreateOptions()["fooBar"],
expected);
});
test( "getting no data when the options are empty", function(){
var expected = {};
test( "getting no data when the options are empty", function(){
var expected = {};
$.mobile.widget.prototype.options = {};
$.mobile.widget.prototype.element = $("<div data-foo-bar=" + expected + ">");
same($.mobile.widget.prototype._getCreateOptions(),
expected);
});
$.mobile.widget.prototype.options = {};
$.mobile.widget.prototype.element = $("<div data-foo-bar=" + expected + ">");
same($.mobile.widget.prototype._getCreateOptions(),
expected);
});
test( "getting no data when the element has none", function(){
var expected = {};
test( "getting no data when the element has none", function(){
var expected = {};
$.mobile.widget.prototype.options = { "fooBar" : true };
$.mobile.widget.prototype.element = $("<div>");
same($.mobile.widget.prototype._getCreateOptions(),
expected);
});
$.mobile.widget.prototype.options = { "fooBar" : true };
$.mobile.widget.prototype.element = $("<div>");
same($.mobile.widget.prototype._getCreateOptions(),
expected);
});
})(jQuery);