diff options
author | Rob Loach <robloach@gmail.com> | 2014-10-16 06:14:42 -0700 |
---|---|---|
committer | Rob Loach <robloach@gmail.com> | 2014-10-16 06:14:42 -0700 |
commit | 09b340240d294f923ae2d0e90ac235830a0e71b0 (patch) | |
tree | 099d42f01010509d2c4b9965fdf6855307ea9995 /test/test.js | |
parent | 57bf227077907c9358cc4e97f679585140bc91c6 (diff) | |
parent | 3fa3482b3c02221ae6380980630b35729fc763f9 (diff) | |
download | jquery-once-09b340240d294f923ae2d0e90ac235830a0e71b0.zip jquery-once-09b340240d294f923ae2d0e90ac235830a0e71b0.tar.gz jquery-once-09b340240d294f923ae2d0e90ac235830a0e71b0.tar.bz2 |
Merge pull request #16 from theodoreb/once-id-required
Remove ability to call once() without a parameter
Diffstat (limited to 'test/test.js')
-rw-r--r-- | test/test.js | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/test/test.js b/test/test.js index d1dbd2f..44ab452 100644 --- a/test/test.js +++ b/test/test.js @@ -1,12 +1,11 @@ -test(".once() properly executed", function() { - // Create one once() call. - $('#test1 span').once().data('test1', 'foo'); - - // Create another once() call. - $('#test1 span').once().data('test1', 'bar'); - - var data = $('#test1 span').data('test1'); - ok(data === "bar"); +test("ID required", function() { + expect(1); + try { + $("#test1 span").once(); + } + catch (e) { + ok(e, "Error is triggered when ID is missing."); + } }); test(".once('test1-2') properly executed", function() { |