coop182/jquery.dfp.js — pull request #32 by larryaubstore (2013-07-10 01:49:42+00:00)
Title: Page exclusion category

I've added the 'category exclusion' feature for page level. I've added as well a couple of unit tests to validate the inputs for ad unit and page level.

I tried as much as possible to test each part of the software separately. It's not always obvious in javascript to isolate software parts.

Basically, I mocked the window.googletag.cmd.push method. In the basic scenario, the plugin may called 'push' at three different places in the code: within 'setOptions' method and within 'createAds' (inside $adCollection loop and right after the loop.) To be able to test the code synchronously, I forced the googletag to call only one specific push. This way it's easier to isolate the part of code you want to test.