mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Add very minimal support for a scripting dictionary — only the getURL
AppleEvent — and add an XCTestCase that can run and verify results of AppleScripts that target Evergreen.
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
|
||||
-- Evergreen scripting unit tests expect a dictionary to be returned from a script
|
||||
-- containing either
|
||||
-- {test_result:true}
|
||||
-- to indicate success or
|
||||
-- {test_result:false}
|
||||
-- to indicate failure
|
||||
-- Data can be passed back to unit test code by including a script_result field
|
||||
-- for example this script returns "Geoducks!" as the result
|
||||
-- this can be used as part of XCTest verification
|
||||
-- see the testGenericScript() function in the ScriptingTests XCTestCase
|
||||
|
||||
return {test_result:true, script_result:"Geoducks!"}
|
||||
19
EvergreenTests/ScriptingTests/scripts/testGetURL.applescript
Normal file
19
EvergreenTests/ScriptingTests/scripts/testGetURL.applescript
Normal file
@@ -0,0 +1,19 @@
|
||||
try
|
||||
tell application "Evergreen"
|
||||
open location "http://scripting.com/rss"
|
||||
end tell
|
||||
on error message
|
||||
return {test_result:false, script_result:message}
|
||||
end
|
||||
|
||||
-- open location is not expected to return a value
|
||||
-- trying to access result should trigger an error, and that indicates a successful test
|
||||
|
||||
try
|
||||
set getURLResult to the result
|
||||
set testResult to false
|
||||
on error message
|
||||
set testResult to true
|
||||
end try
|
||||
|
||||
return {test_result:testResult}
|
||||
Reference in New Issue
Block a user