CB-13145 : added getFrameworks to unit tests

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

Branch: refs/heads/2.1.x
Commit: 623039ff6ecb6b522dd5d6da10560cbedded8310
Parents: c38a220
Author: Steve Gill <[email protected]>
Authored: Thu Aug 17 17:18:12 2017 -0700
Committer: Audrey So <[email protected]>
Committed: Mon Sep 25 10:54:22 2017 -0700

----------------------------------------------------------------------
 spec/PluginInfo/PluginInfo.spec.js | 6 ++++++
 src/PluginInfo/PluginInfo.js       | 1 -
 2 files changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-common/blob/623039ff/spec/PluginInfo/PluginInfo.spec.js
----------------------------------------------------------------------
diff --git a/spec/PluginInfo/PluginInfo.spec.js 
b/spec/PluginInfo/PluginInfo.spec.js
index e7a7c4f..5fdaf87 100644
--- a/spec/PluginInfo/PluginInfo.spec.js
+++ b/spec/PluginInfo/PluginInfo.spec.js
@@ -64,4 +64,10 @@ describe('PluginInfo', function () {
         var result = p.getFrameworks('android', {cli_variables: { FCM_VERSION: 
'9.0.0' }});
         
expect(result[2].src).toBe('com.google.firebase:firebase-messaging:9.0.0');
     });
+
+    it('Test 004: framework src uses default variable', function () {
+        var p = new PluginInfo(path.join(pluginsDir, 'org.test.src'));
+        var result = p.getFrameworks('android', {});
+        
expect(result[2].src).toBe('com.google.firebase:firebase-messaging:11.0.1');
+    });
 });

http://git-wip-us.apache.org/repos/asf/cordova-common/blob/623039ff/src/PluginInfo/PluginInfo.js
----------------------------------------------------------------------
diff --git a/src/PluginInfo/PluginInfo.js b/src/PluginInfo/PluginInfo.js
index ae003c9..7e9754d 100644
--- a/src/PluginInfo/PluginInfo.js
+++ b/src/PluginInfo/PluginInfo.js
@@ -317,7 +317,6 @@ function PluginInfo (dirname) {
                     // get variable defaults from plugin.xml for removal
                     vars = self.getPreferences(platform);
                 }
-                
                 var regExp;
                 // Iterate over plugin variables.
                 // Replace them in framework src if they exist


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to