cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fil...@apache.org
Subject [14/20] git commit: fixed blackberry specs
Date Thu, 16 May 2013 15:57:13 GMT
fixed blackberry specs


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

Branch: refs/heads/master
Commit: 4cb155cd9b029e307518082579b3c0e52371aad8
Parents: a99a9d3
Author: Fil Maj <maj.fil@gmail.com>
Authored: Wed May 15 15:31:19 2013 -0700
Committer: Fil Maj <maj.fil@gmail.com>
Committed: Thu May 16 08:55:43 2013 -0700

----------------------------------------------------------------------
 spec/platforms/blackberry.spec.js |   29 +++++++++++++++++------------
 1 files changed, 17 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/4cb155cd/spec/platforms/blackberry.spec.js
----------------------------------------------------------------------
diff --git a/spec/platforms/blackberry.spec.js b/spec/platforms/blackberry.spec.js
index c59af0c..9040b6f 100644
--- a/spec/platforms/blackberry.spec.js
+++ b/spec/platforms/blackberry.spec.js
@@ -37,14 +37,15 @@ function copyArray(arr) {
 }
 
 describe('blackberry project handler', function() {
-    it('should have an install function', function() {
-        expect(typeof blackberry.install).toEqual('function');
-    });
-    it('should have an uninstall function', function() {
-        expect(typeof blackberry.uninstall).toEqual('function');
+    describe('www_dir method', function() {
+        it('should return cordova-blackberry project www location using www_dir', function()
{
+            expect(blackberry.www_dir('/')).toEqual('/www');
+        });
     });
-    it('should return cordova-blackberry project www location using www_dir', function()
{
-        expect(blackberry.www_dir('/')).toEqual('/www');
+    describe('package_name method', function() {
+        it('should return the blackberry project package name based on what is in config.xml',
function() {
+            expect(blackberry.package_name(path.join(blackberry_project, '..'))).toEqual('cordovaExample');
+        });
     });
 
     describe('installation', function() {
@@ -59,7 +60,9 @@ describe('blackberry project handler', function() {
             it('should copy stuff from one location to another by calling common.copyFile',
function() {
                 var source = copyArray(valid_source);
                 var s = spyOn(common, 'copyFile');
-                blackberry.install(source, dummy_id, temp, dummyplugin, {});
+                source.forEach(function(src) {
+                    blackberry['source-file'].install(src, dummyplugin, temp);
+                });
                 expect(s).toHaveBeenCalledWith(dummyplugin, 'src/blackberry/client.js', temp,
'ext-qnx/cordova.echo/client.js');
                 expect(s).toHaveBeenCalledWith(dummyplugin, 'src/blackberry/index.js', temp,
'ext-qnx/cordova.echo/index.js');
                 expect(s).toHaveBeenCalledWith(dummyplugin, 'src/blackberry/manifest.json',
temp, 'ext-qnx/cordova.echo/manifest.json');
@@ -67,7 +70,7 @@ describe('blackberry project handler', function() {
             it('should throw if source file cannot be found', function() {
                 var source = copyArray(invalid_source);
                 expect(function() {
-                    blackberry.install(source, faulty_id, temp, faultyplugin, {});
+                    blackberry['source-file'].install(source[1], faultyplugin, temp);
                 }).toThrow('"' + path.resolve(faultyplugin, 'src/blackberry/device/echoJnext.so')
+ '" not found!');
             });
             it('should throw if target file already exists', function() {
@@ -79,7 +82,7 @@ describe('blackberry project handler', function() {
 
                 var source = copyArray(valid_source);
                 expect(function() {
-                    blackberry.install(source, dummy_id, temp, dummyplugin, {});
+                    blackberry['source-file'].install(source[0], dummyplugin, temp);
                 }).toThrow('"' + target + '" already exists!');
             });
         });
@@ -98,9 +101,11 @@ describe('blackberry project handler', function() {
         describe('of <source-file> elements', function() {
             it('should remove stuff by calling common.deleteJava', function(done) {
                 var s = spyOn(common, 'deleteJava');
-                install('blackberry', temp, 'DummyPlugin', plugins_dir, {}, undefined, function()
{
+                install('blackberry', temp, 'DummyPlugin', plugins_dir, '.', {}, undefined,
function() {
                     var source = copyArray(valid_source);
-                    blackberry.uninstall(source, dummy_id, temp, path.join(plugins_dir, 'DummyPlugin'));
+                    source.forEach(function(src) {
+                        blackberry['source-file'].uninstall(src, temp);
+                    });
                     expect(s).toHaveBeenCalledWith(temp, 'ext-qnx/cordova.echo/client.js');
                     expect(s).toHaveBeenCalledWith(temp, 'ext-qnx/cordova.echo/index.js');
                     expect(s).toHaveBeenCalledWith(temp, 'ext-qnx/cordova.echo/manifest.json');


Mime
View raw message