Skip to content

Commit

Permalink
Add a unit test to test source-file target-dir /app/src/main/… (PR ap…
Browse files Browse the repository at this point in the history
  • Loading branch information
kkirby authored and Christopher J. Brody committed Nov 16, 2018
1 parent 9f6c332 commit c0e9f25
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions spec/fixtures/org.test.plugins.dummyplugin/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@

<source-file src="src/android/DummyPlugin.java"
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" />
</platform>
</plugin>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
./org.test.plugins.dummyplugin/src/android/DummyPlugin2.java
6 changes: 6 additions & 0 deletions spec/unit/pluginHandlers/handlers.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 <framework> elements', function () {
Expand Down

0 comments on commit c0e9f25

Please sign in to comment.