Add a unit test to test source-file target-dir /app/src/main/…

This commit is contained in:
Kyle Kirbatski 2018-11-08 12:23:29 -06:00 committed by Christopher J. Brody
parent 7da53741cd
commit 898a6a8d8d
3 changed files with 9 additions and 0 deletions

View File

@ -70,6 +70,8 @@
<source-file src="src/android/DummyPlugin.java" <source-file src="src/android/DummyPlugin.java"
target-dir="src/com/phonegap/plugins/dummyplugin" /> target-dir="src/com/phonegap/plugins/dummyplugin" />
<source-file src="src/android/DummyPlugin2.java"
target-dir="app/src/main/src/com/phonegap/plugins/dummyplugin" />
<lib-file src="src/android/TestLib.jar" /> <lib-file src="src/android/TestLib.jar" />
</platform> </platform>
</plugin> </plugin>

View File

@ -0,0 +1 @@
./org.test.plugins.dummyplugin/src/android/DummyPlugin2.java

View File

@ -102,6 +102,12 @@ describe('android project handler', function () {
android['source-file'].install(valid_source[0], dummyPluginInfo, dummyProject); android['source-file'].install(valid_source[0], dummyPluginInfo, dummyProject);
}).toThrow(new Error('"' + target + '" already exists!')); }).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 <framework> elements', function () { describe('of <framework> elements', function () {