diff options
author | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2009-09-15 08:26:59 +0000 |
---|---|---|
committer | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2009-09-15 08:26:59 +0000 |
commit | a282bba6cdb63f2565562e358c93b9643ff09b54 (patch) | |
tree | c1183e7647ba3b8b0fc4a1f0f7e9c79628a3cd77 /tests/unit/testsuite.js | |
parent | 526f6c565caf26e0746a344e9999fa050a0a4078 (diff) | |
download | jquery-ui-a282bba6cdb63f2565562e358c93b9643ff09b54.tar.gz jquery-ui-a282bba6cdb63f2565562e358c93b9643ff09b54.zip |
common widget tests: improve handling of functions (even same() can't compare two functions by their "content")
Diffstat (limited to 'tests/unit/testsuite.js')
-rw-r--r-- | tests/unit/testsuite.js | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/unit/testsuite.js b/tests/unit/testsuite.js index ca1463e47..1efb8b287 100644 --- a/tests/unit/testsuite.js +++ b/tests/unit/testsuite.js @@ -8,13 +8,17 @@ function testWidgetDefaults(widget, defaults) { // ensure that all defualts have the correct value test('defined defaults', function() { $.each(defaults, function(key, val) { + if ($.isFunction(val)) { + ok(val !== undefined); + return; + } same(pluginDefaults[key], val, key); }); }); // ensure that all defaults were tested test('tested defaults', function() { - $.each(pluginDefaults, function(key) { + $.each(pluginDefaults, function(key, val) { ok(key in defaults, key); }); }); @@ -25,6 +29,10 @@ function testWidgetDefaults(widget, defaults) { instance = el.data(widget); $.each(defaults, function(key, val) { + if ($.isFunction(val)) { + ok(val !== undefined); + return; + } same(instance.options[key], val, key); }); el.remove(); |