cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fil...@apache.org
Subject [77/78] git commit: done with android parser specs
Date Thu, 13 Jun 2013 18:22:40 GMT
done with android parser specs


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

Branch: refs/heads/master2
Commit: c86c7f841812bf779f55b3fb3f9f0cc1000efac1
Parents: c04ca9d
Author: Fil Maj <maj.fil@gmail.com>
Authored: Thu Jun 13 11:07:04 2013 -0700
Committer: Fil Maj <maj.fil@gmail.com>
Committed: Thu Jun 13 11:13:22 2013 -0700

----------------------------------------------------------------------
 spec/metadata/android_parser.spec.js | 35 +++++++++++++++++++++++++++++--
 1 file changed, 33 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/c86c7f84/spec/metadata/android_parser.spec.js
----------------------------------------------------------------------
diff --git a/spec/metadata/android_parser.spec.js b/spec/metadata/android_parser.spec.js
index 82662fa..f2fd28d 100644
--- a/spec/metadata/android_parser.spec.js
+++ b/spec/metadata/android_parser.spec.js
@@ -88,27 +88,58 @@ describe('android project parser', function() {
     });
 
     describe('instance', function() {
-        var p, cp, is_cordova;
+        var p, cp, rm, is_cordova, write;
+        var android_proj = path.join(proj, 'platforms', 'android');
         beforeEach(function() {
-            p = new platforms.android.parser(proj);
+            p = new platforms.android.parser(android_proj);
             cp = spyOn(shell, 'cp');
+            rm = spyOn(shell, 'rm');
             is_cordova = spyOn(util, 'isCordova').andReturn(proj);
+            write = spyOn(fs, 'writeFileSync');
         });
 
         describe('update_from_config method', function() {
+            it('should write out the app name to strings.xml');
+            it('should write out the app id to androidmanifest.xml and update the cordova-android
entry Java class');
+            it('should write out the app version to androidmanifest.xml');
+            it('should update the whitelist');
+            it('should update preferences');
         });
         describe('www_dir method', function() {
+            it('should return assets/www', function() {
+                expect(p.www_dir()).toEqual(path.join(android_proj, 'assets', 'www'));
+            });
         });
         describe('staging_dir method', function() {
+            it('should return .staging/www', function() {
+                expect(p.staging_dir()).toEqual(path.join(android_proj, '.staging', 'www'));
+            });
         });
         describe('config_xml method', function() {
+            it('should return the location of the config.xml', function() {
+                expect(p.config_xml()).toEqual(p.android_config);
+            });
         });
         describe('update_www method', function() {
+            it('should rm project-level www and cp in platform agnostic www', function()
{
+                p.update_www();
+                expect(rm).toHaveBeenCalled();
+                expect(cp).toHaveBeenCalled();
+            });
+            it('should copy in a fresh cordova.js', function() {
+                p.update_www();
+                expect(write).toHaveBeenCalled();
+            });
         });
         describe('update_overrides method', function() {
             it('should do nothing if merges directory does not exist', function() {
+                exists.andReturn(false);
+                p.update_overrides();
+                expect(cp).not.toHaveBeenCalled();
             });
             it('should copy merges path into www', function() {
+                p.update_overrides();
+                expect(cp).toHaveBeenCalled();
             });
         });
         describe('update_staging method', function() {


Mime
View raw message