You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by dr...@apache.org on 2014/01/07 16:24:28 UTC

git commit: CB-4976 fix tests to handle local dir case

Updated Branches:
  refs/heads/master 2ebd0cc8b -> 4b9269abb


CB-4976 fix tests to handle local dir case


Project: http://git-wip-us.apache.org/repos/asf/cordova-cli/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-cli/commit/4b9269ab
Tree: http://git-wip-us.apache.org/repos/asf/cordova-cli/tree/4b9269ab
Diff: http://git-wip-us.apache.org/repos/asf/cordova-cli/diff/4b9269ab

Branch: refs/heads/master
Commit: 4b9269abbc7cff68e87db52b3f7948636bf796d8
Parents: 2ebd0cc
Author: David Kemp <dr...@chromium.org>
Authored: Tue Jan 7 10:23:24 2014 -0500
Committer: David Kemp <dr...@chromium.org>
Committed: Tue Jan 7 10:23:24 2014 -0500

----------------------------------------------------------------------
 spec/lazy_load.spec.js | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/4b9269ab/spec/lazy_load.spec.js
----------------------------------------------------------------------
diff --git a/spec/lazy_load.spec.js b/spec/lazy_load.spec.js
index d63eeb2..b4d97f3 100644
--- a/spec/lazy_load.spec.js
+++ b/spec/lazy_load.spec.js
@@ -68,12 +68,20 @@ describe('lazy_load module', function() {
 
         it('should callback with no errors and not fire event hooks if library already exists', function(done) {
             exists.andReturn(true);
-            lazy_load.custom('some url', 'some id', 'platform X', 'three point five').then(function() {
+            lazy_load.custom('http://some remote url', 'some id', 'platform X', 'three point five').then(function() {
                 expect(fire).not.toHaveBeenCalled()
             }, function(err) {
                 expect(err).not.toBeDefined();
             }).fin(done);
         });
+        it('should callback with no errors and fire event hooks even if library already exists if the lib url is a local dir', function(done) {
+            exists.andReturn(true);
+            lazy_load.custom('some local dir', 'some id', 'platform X', 'three point five').then(function() {
+                expect(fire).toHaveBeenCalled()
+            }, function(err) {
+                expect(err).not.toBeDefined();
+            }).fin(done);
+        });
         it('should fire a before_library_download event before it starts downloading a library', function(done) {
             lazy_load.custom('some url', 'some id', 'platform X', 'three point five').then(function() {
                 expect(fire).toHaveBeenCalledWith('before_library_download', {platform:'platform X', url:'some url', id:'some id', version:'three point five'});