From c0e9f2515046b8f927dea4b0646d6dd3acfd1c40 Mon Sep 17 00:00:00 2001 From: Kyle Kirbatski Date: Thu, 8 Nov 2018 12:23:29 -0600 Subject: [PATCH] =?UTF-8?q?Add=20a=20unit=20test=20to=20test=20source-file?= =?UTF-8?q?=20target-dir=20/app/src/main/=E2=80=A6=20(PR=20#542)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- spec/fixtures/org.test.plugins.dummyplugin/plugin.xml | 2 ++ .../src/android/DummyPlugin2.java | 1 + spec/unit/pluginHandlers/handlers.spec.js | 6 ++++++ 3 files changed, 9 insertions(+) create mode 100644 spec/fixtures/org.test.plugins.dummyplugin/src/android/DummyPlugin2.java diff --git a/spec/fixtures/org.test.plugins.dummyplugin/plugin.xml b/spec/fixtures/org.test.plugins.dummyplugin/plugin.xml index a40df2b2..5451ef8d 100644 --- a/spec/fixtures/org.test.plugins.dummyplugin/plugin.xml +++ b/spec/fixtures/org.test.plugins.dummyplugin/plugin.xml @@ -70,6 +70,8 @@ + diff --git a/spec/fixtures/org.test.plugins.dummyplugin/src/android/DummyPlugin2.java b/spec/fixtures/org.test.plugins.dummyplugin/src/android/DummyPlugin2.java new file mode 100644 index 00000000..c2dd0f73 --- /dev/null +++ b/spec/fixtures/org.test.plugins.dummyplugin/src/android/DummyPlugin2.java @@ -0,0 +1 @@ +./org.test.plugins.dummyplugin/src/android/DummyPlugin2.java diff --git a/spec/unit/pluginHandlers/handlers.spec.js b/spec/unit/pluginHandlers/handlers.spec.js index edc8f43b..19abab8c 100644 --- a/spec/unit/pluginHandlers/handlers.spec.js +++ b/spec/unit/pluginHandlers/handlers.spec.js @@ -108,6 +108,12 @@ describe('android project handler', function () { android['source-file'].install(valid_source[0], dummyPluginInfo, dummyProject); }).toThrow(new Error('"' + target + '" already exists!')); }); + + it('Test#007 : should allow installing sources using proper path', function () { + android['source-file'].install(valid_source[1], dummyPluginInfo, dummyProject, {android_studio: true}); + expect(copyFileSpy) + .toHaveBeenCalledWith(dummyplugin, 'src/android/DummyPlugin2.java', temp, path.join('app/src/main/src/com/phonegap/plugins/dummyplugin/DummyPlugin2.java'), false); + }); }); describe('of elements', function () {