GroovyEvaluatorTests.st
changeset 3035 36a4e9ab4d00
parent 3032 590aa6c3cb24
child 3123 81791eb890eb
--- a/GroovyEvaluatorTests.st	Tue Feb 25 17:01:07 2014 +0000
+++ b/GroovyEvaluatorTests.st	Tue Mar 04 13:36:38 2014 +0000
@@ -107,13 +107,12 @@
 test_workspace_01
     | ws retval |
 
-    ws := WorkspaceApplication new.
-    ws allButOpen.
+    self skipIf: Screen current isNil description: 'This test needs connection to display'.
 
-    retval := GroovyEvaluator evaluate: 'a = 1; a' notifying: ws selectedWorkspacesTextView.
-
+    ws := Workspace new.
+    retval := GroovyEvaluator evaluate: 'a = 1; a' notifying: ws.
     self assert: retval = 1.
-    self assert: (Workspace workspaceVariables includesKey: 'a').  
+    self assert: (Workspace workspaceVariables includesKey: 'a').
     self assert: (Workspace workspaceVariableAt: 'a') value == 1.
 
     "Created: / 19-02-2014 / 09:02:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
@@ -122,12 +121,11 @@
 test_workspace_02a
     | ws retval |
 
-    <skip> "/ Crashes VM, have to investigate...    
+    <skip> "/ Crashes VM, have to investigate...
 
-    ws := WorkspaceApplication new.
-    ws allButOpen.
-    Workspace workspaceVariables at: 'x' put: 10.    
-    retval := GroovyEvaluator evaluate: '10 + x' notifying: ws selectedWorkspacesTextView.
+    ws := Workspace new.
+    Workspace workspaceVariables at: 'x' put: 10.
+    retval := GroovyEvaluator evaluate: '10 + x' notifying: ws.
 
     self assert: retval = 20.
 
@@ -137,12 +135,12 @@
 test_workspace_02b
     | ws retval obj |
 
-    ws := WorkspaceApplication new.
-    ws allButOpen.
+    self skipIf: Screen current isNil description: 'This test needs connection to display'.
 
+    ws := Workspace new.
     obj := JAVA java lang Object new.
-    Workspace workspaceVariables at: 'x' put: obj asValue.    
-    retval := GroovyEvaluator evaluate: 'x.hashCode()' notifying: ws selectedWorkspacesTextView.
+    Workspace workspaceVariables at: 'x' put: obj asValue.
+    retval := GroovyEvaluator evaluate: 'x.hashCode()' notifying: ws.
 
     self assert: retval = obj hash.
 
@@ -152,12 +150,12 @@
 test_workspace_03
     | ws retval o |
 
-    ws := WorkspaceApplication new.
-    ws allButOpen.
+    self skipIf: Screen current isNil description: 'This test needs connection to display'.
 
+    ws := Workspace new.
     o := Object new.
-    Workspace workspaceVariables at: 'y' put: o asValue.    
-    retval := GroovyEvaluator evaluate: 'y' notifying: ws selectedWorkspacesTextView.
+    Workspace workspaceVariables at: 'y' put: o asValue.
+    retval := GroovyEvaluator evaluate: 'y' notifying: ws.
     self assert: retval == o.
 
     "Created: / 19-02-2014 / 09:07:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"