[GitHub] cordova-lib pull request #581: CB-12361 : added plugin remove tests

2017-08-11 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/cordova-lib/pull/581


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-lib pull request #581: CB-12361 : added plugin remove tests

2017-08-11 Thread stevengill
Github user stevengill commented on a diff in the pull request:

https://github.com/apache/cordova-lib/pull/581#discussion_r132758854
  
--- Diff: spec/cordova/plugin/remove.spec.js ---
@@ -32,18 +66,123 @@ describe('cordova/plugin/remove', function () {
 expect(e.message).toContain('No plugin specified');
 }).done(done);
 });
-it('should require that a provided plugin be installed in the 
current project');
+
+it('should require that a provided plugin be installed in the 
current project', function (done) {
+var opts = { plugins: [ undefined ] };
+remove(projectRoot, 'plugin', hook_mock, opts).then(function 
() {
+fail('success handler unexpectedly invoked');
+}).fail(function (e) {
+expect(e.message).toContain('is not present in the 
project');
+}).done(done);
+});
 });
 describe('happy path', function () {
-it('should fire the before_plugin_rm hook');
-it('should call plugman.uninstall.uninstallPlatform for each 
platform installed in the project and for each provided plugin');
-it('should trigger a prepare if 
plugman.uninstall.uninstallPlatform returned something falsy');
-it('should call plugman.uninstall.uninstallPlugin once plugin has 
been uninstalled for each platform');
+it('should fire the before_plugin_rm hook', function (done) {
+var opts = { important: 'options', plugins: [] };
+remove(projectRoot, 'cordova-plugin-splashscreen', hook_mock, 
opts).then(function () {
+
expect(hook_mock.fire).toHaveBeenCalledWith('before_plugin_rm', opts);
+}).fail(function (e) {
+fail('fail handler unexpectedly invoked');
+console.error(e);
+}).done(done);
+});
+
+it('should call plugman.uninstall.uninstallPlatform for each 
platform installed in the project and for each provided plugin', function 
(done) {
+
remove.validatePluginId.and.returnValue('cordova-plugin-splashscreen');
+var opts = {important: 'options', plugins: 
['cordova-plugin-splashscreen']};
+remove(projectRoot, 'cordova-plugin-splashscreen', hook_mock, 
opts).then(function () {
+
expect(plugman.uninstall.uninstallPlatform).toHaveBeenCalled();
+expect(events.emit).toHaveBeenCalledWith('verbose', 
jasmine.stringMatching('plugman.uninstall on plugin 
"cordova-plugin-splashscreen" for platform "ios"'));
+expect(events.emit).toHaveBeenCalledWith('verbose', 
jasmine.stringMatching('plugman.uninstall on plugin 
"cordova-plugin-splashscreen" for platform "android"'));
+}).fail(function (e) {
+fail('fail handler unexpectedly invoked');
+console.error(e);
+}).done(done);
+});
+
+it('should trigger a prepare if 
plugman.uninstall.uninstallPlatform returned something falsy', function (done) {
+
remove.validatePluginId.and.returnValue('cordova-plugin-splashscreen');
+plugman.uninstall.uninstallPlatform.and.returnValue(Q(false));
+var opts = {important: 'options', plugins: 
['cordova-plugin-splashscreen']};
+remove(projectRoot, 'cordova-plugin-splashscreen', hook_mock, 
opts).then(function () {
+
expect(plugman.uninstall.uninstallPlatform).toHaveBeenCalled();
+expect(events.emit).toHaveBeenCalledWith('verbose', 
'Calling prepare.');
--- End diff --

i'd suggest removing this expect event due to my other comment


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-lib pull request #581: CB-12361 : added plugin remove tests

2017-07-21 Thread audreyso
GitHub user audreyso opened a pull request:

https://github.com/apache/cordova-lib/pull/581

CB-12361 : added plugin remove tests



### Platforms affected


### What does this PR do?

Added plugin remove tests.

### What testing has been done on this change?


### Checklist
- [X] [Reported an issue](http://cordova.apache.org/contribute/issues.html) 
in the JIRA database
- [X] Commit message follows the format: "CB-3232: (android) Fix bug with 
resolving file paths", where CB- is the JIRA ID & "android" is the platform 
affected.
- [X] Added automated test coverage as appropriate for this change.


You can merge this pull request into a Git repository by running:

$ git pull https://github.com/audreyso/cordova-lib CB-12361-13-plugin

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/cordova-lib/pull/581.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #581


commit f2326ca2b291aef0736b8924d060fe5bd219b1cd
Author: Audrey So 
Date:   2017-07-20T23:19:07Z

CB-12361 : added plugin remove tests




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org