diff options
| author | Igor Minar | 2010-10-01 16:06:32 -0700 | 
|---|---|---|
| committer | Igor Minar | 2010-10-01 16:06:32 -0700 | 
| commit | 87f9a4c5660903893ccceca15987cf00d1495758 (patch) | |
| tree | 1df852ac0fec6d5810ad6eef28f5907be2b2f43a /test | |
| parent | 8248e77a7b910bcbc71ca25c06bef44dd6712990 (diff) | |
| download | angular.js-87f9a4c5660903893ccceca15987cf00d1495758.tar.bz2 | |
angular-mocks code should access all global functions via angular
mocks must use angular.foo because the final build will hide all
the normally accessible functions within an anonymous closure.
Diffstat (limited to 'test')
| -rw-r--r-- | test/angular-mocks.js | 44 | 
1 files changed, 40 insertions, 4 deletions
diff --git a/test/angular-mocks.js b/test/angular-mocks.js index 1a73a542..7444e816 100644 --- a/test/angular-mocks.js +++ b/test/angular-mocks.js @@ -22,6 +22,40 @@   * THE SOFTWARE.   */ + +/* + + NUGGGGGH MUST TONGUE WANGS +                           \ +                                ..... +                               C C  / +                              /<   / +               ___ __________/_#__=o +              /(- /(\_\________   \ +              \ ) \ )_      \o     \ +              /|\ /|\       |'     | +                            |     _| +                            /o   __\ +                           / '     | +                          / /      | +                         /_/\______| +                        (   _(    < +                         \    \    \ +                          \    \    | +                           \____\____\ +                           ____\_\__\_\ +                         /`   /`     o\ +                         |___ |_______|.. . b'ger + + + IN THE FINAL BUILD THIS FILE DOESN'T HAVE DIRECT ACCESS TO GLOBAL FUNCTIONS + DEFINED IN Angular.js YOU *MUST* REFER TO THEM VIA angular OBJECT + (e.g. angular.forEach(...)) AND MAKE SURE THAT THE GIVEN FUNCTION IS EXPORTED + TO THE angular NAMESPACE in AngularPublic.js + + */ + +  function MockBrowser() {    var self = this,        expectations = {}, @@ -80,7 +114,9 @@ function MockBrowser() {  MockBrowser.prototype = {    poll: function poll(){ -    foreach(this.pollFns, function(pollFn){ pollFn(); }); +    angular.foreach(this.pollFns, function(pollFn){ +      pollFn(); +    });    },    addPollFn: function(pollFn) { @@ -104,13 +140,13 @@ MockBrowser.prototype = {        if (value == undefined) {          delete this.cookieHash[name];        } else { -        if (isString(value) &&       //strings only -            value.length <= 4096) {  //strict cookie storage limits +        if (angular.isString(value) &&       //strings only +            value.length <= 4096) {          //strict cookie storage limits            this.cookieHash[name] = value;          }        }      } else { -      if (!equals(this.cookieHash, this.lastCookieHash)) { +      if (!angular.equals(this.cookieHash, this.lastCookieHash)) {          this.lastCookieHash = copy(this.cookieHash);          this.cookieHash = copy(this.cookieHash);        }  | 
