bpoole16 commented on a change in pull request #2520: Prints 
bashauto-completion install script to STDOUT
URL: 
https://github.com/apache/incubator-openwhisk/pull/2520#discussion_r130692193
 
 

 ##########
 File path: tests/src/test/scala/system/basic/WskSdkTests.scala
 ##########
 @@ -89,23 +89,14 @@ class WskSdkTests
         FileUtils.deleteDirectory(dir)
     }
 
-    it should "install the bash auto-completion bash script" in {
-        // Use a temp dir for testing to not disturb user's local folder
-        val dir = File.createTempFile("wskinstall", ".tmp")
-        dir.delete()
-        dir.mkdir() should be(true)
 
-        val scriptfilename = "wsk_cli_bash_completion.sh"
-        var scriptfile = new File(dir.getPath(), scriptfilename)
-        try {
-            val stdout = wsk.cli(Seq("sdk", "install", "bashauto"), workingDir 
= dir, expectedExitCode = SUCCESS_EXIT).stdout
-            stdout should include("is installed in the current directory")
-            val fileContent = FileUtils.readFileToString(scriptfile)
-            fileContent should include("bash completion for wsk")
-        } finally {
-            scriptfile.delete()
-            FileUtils.deleteDirectory(dir)
-        }
+    it should "install the bash auto-completion bash script using --bashrc 
flag" in {
+        val auth: Seq[String] = Seq("--auth", wskprops.authKey)
+        val msg = "bash completion for wsk"    // Subject to change, dependent 
on Cobra script
+        // Doesn't actually install, simply checking if the command is 
printing correctly to STDOUT
+        val stdout = wsk.cli(Seq("sdk", "install", "bashauto", "--bashrc") ++ 
wskprops.overrides ++ auth, expectedExitCode = SUCCESS_EXIT).stdout
+
+        stdout should include(msg)
 
 Review comment:
   I could replace the test to just make sure it prints correctly to stdout and 
to a file if you want.  
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to