Google Groups Home
Help | Sign in
[476] Added Windows Scripting Host support.
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  1 message - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
ca...@geeknest.com  
View profile
 More options Mar 23 2006, 3:31 pm
From: ca...@geeknest.com
Date: Thu, 23 Mar 2006 15:31:39 -0500 (EST)
Local: Thurs, Mar 23 2006 3:31 pm
Subject: [svn openjsan.org] [476] Added Windows Scripting Host support.
Revision: 476
Author:   theory
Date:     2006-03-23 15:31:32 -0500 (Thu, 23 Mar 2006)

Log Message:
-----------
Added Windows Scripting Host support. W00t!

Modified Paths:
--------------
    users/theory/Test.Simple/trunk/doc/pod/Test/Builder.pod
    users/theory/Test.Simple/trunk/lib/Test/Builder.js
Modified: users/theory/Test.Simple/trunk/doc/pod/Test/Builder.pod
===================================================================
--- users/theory/Test.Simple/trunk/doc/pod/Test/Builder.pod     2006-03-15 01:05:48 UTC (rev 475)
+++ users/theory/Test.Simple/trunk/doc/pod/Test/Builder.pod     2006-03-23 20:31:32 UTC (rev 476)
@@ -35,8 +35,16 @@

 =item browser

+A Web browser.
+
 =item director

+Adobe Director.
+
+=item wsh
+
+Windows Scripting Host.
+
 =back

 =back
@@ -390,11 +398,12 @@

 These methods specify where test output and diagnostics will be sent. By
 default, in a browser they all default to appending to the element with the
-"test" ID or, failing that, to using C<document.write>. In Macromedia
-Director, they use C<trace> for their output. If you wish to specify other
-functions that lack the C<apply()> method, you'll need to supply them instead
-as custom anonymous functions that take a single argument (multiple arguments
-will be concatenated before being passed to the output function):
+"test" ID or, failing that, to using C<document.write()>. In Adobe Director,
+they use C<trace()> for their output, and in Windows Scripting Host, they use
+C<WScript.StdOut.writeline()>. If you wish to specify other functions that
+lack the C<apply()> method, you'll need to supply them instead as custom
+anonymous functions that take a single argument (multiple arguments will be
+concatenated before being passed to the output function):

   Test.output(function (msg) { foo(msg) });

@@ -666,8 +675,8 @@
 global namespace. It is only used if JSAN (L<http://www.openjsan.org/>) is not
 available. Other test modules built with Test.Builder should also use this
 method to export functions. An optional second argument specifies the name
-space in which to export the functionls. Ifis not defined, it defaults to the
-C<window> object in browsers and the C<_global> object in Director.
+space in which to export the functionls. If it is not defined, it defaults to
+the C<window> object in browsers and the C<_global> object in Director.

 =back

Modified: users/theory/Test.Simple/trunk/lib/Test/Builder.js
===================================================================
--- users/theory/Test.Simple/trunk/lib/Test/Builder.js  2006-03-15 01:05:48 UTC (rev 475)
+++ users/theory/Test.Simple/trunk/lib/Test/Builder.js  2006-03-23 20:31:32 UTC (rev 476)
@@ -9,6 +9,10 @@
     //Director
     if (typeof _global.Test == "undefined") _global.Test = {PLATFORM: 'director'};
     else _global.Test.PLATFORM = 'director';
+} else if (typeof WScript != 'undefined') {
+    // WSH
+    if (typeof Test == 'undefined') Test = {PLATFORM: 'wsh'};
+    else Test.PLATFORM = 'wsh';
 } else {
     throw new Error("Test.More does not support your platform");
 }
@@ -613,8 +617,18 @@
         this.failureOutput(trace);
         this.todoOutput(trace);
         this.warnOutput(trace);
-    }

+        
+    } else if (Test.PLATFORM == 'wsh') {
+        // Windows Scripting Host Support
+        var writer = function (msg) {
+                       WScript.StdOut.writeline(msg);
+               }
+               this.output(writer);
+               this.failureOutput(writer);
+               this.todoOutput(writer);
+               this.warnOutput(writer);
+       }
     return this;
 };


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google