Added additional asserts into #setUp to make sure the testing environment is in expected state jv
authorPatrik Svestka <patrik.svestka@gmail.com>
Wed, 03 Jun 2020 14:16:30 +0200
branchjv
changeset 2592 7aa9af5b0ddb
parent 2214 ba58ef8a6214
child 2593 773015856b61
Added additional asserts into #setUp to make sure the testing environment is in expected state
RegressionTests__Win32OperatingSystemTest.st
--- a/RegressionTests__Win32OperatingSystemTest.st	Tue Apr 09 11:18:28 2019 +0200
+++ b/RegressionTests__Win32OperatingSystemTest.st	Wed Jun 03 14:16:30 2020 +0200
@@ -377,7 +377,7 @@
 !Win32OperatingSystemTest methodsFor:'release'!
 
 setUp
-    | registryToImport file |
+    | registryToImport file returnString |
 
     self skipIf: OperatingSystem isMSWINDOWSlike not description: 'Windows only tests (registry manipulation)'.
     super setUp.
@@ -412,14 +412,19 @@
     ].    
     
     "/ this is UTF16-LE (Little Endian) Without Signature (BOM)
-    file appendingFileDo: [ :stream | stream nextPutAllUtf16Bytes: registryToImport MSB: false].
+    file appendingFileDo: [ :stream | stream nextPutAllUtf16Bytes: registryToImport MSB: false ].
      
     [   "/ adding registry entry so we can test it
-        OperatingSystem getCommandOutputFrom: ('REG IMPORT ' , file asString)
+        returnString := OperatingSystem getCommandOutputFrom: ('REG IMPORT ' , file asString)
     ] ensure: [ file remove ].
+    
+    "/ should REG IMPORT command fail the returnString is nil
+    self deny: returnString isNil.
+    "/ Check if testing registry entry was correctly created
+    self deny: (OperatingSystem registryEntry key: registryPath) isNil.
 
     "Created: / 28-12-2016 / 22:12:14 / jv"
-    "Modified: / 12-02-2019 / 14:34:52 / svestkap"
+    "Modified (comment): / 03-06-2020 / 12:59:37 / svestkap"
 !
 
 tearDown