Permalink
Browse files

Merge branch 'integration-yuitest'

  • Loading branch information...
2 parents 569c6c0 + 1aafe1c commit 9777a6a884eee31e971202dab8c9b3ceb81f33a4 @keronsen keronsen committed Nov 10, 2009
@@ -0,0 +1,71 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ko">
+<head>
+<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
+<title>YUI Test results</title>
+
+<link rel="stylesheet" type="text/css" href="lib/yuitest.css">
+<script type="text/javascript" src="lib/yuitest.js"></script>
+
+<script type="text/javascript" src="../../../src/jack.js"></script>
+
+</head>
+<body>
+ <script type="text/javascript">
+
+ /** START SPECIFYING FUNCTIONS THAT TESTS RUN AGAINST **/
+ function myGlobalFunction() {
+ return "This is myGlobalFunction()";
+ }
+
+ window.myGlobalObject = {}
+ window.myGlobalObject.functionOne = function() {
+ return "This is myGlobalObject.functionOne()";
+ }
+ /** END SPECIFYING FUNCTIONS THAT TESTS RUN AGAINST **/
+
+ var successfulTestCase = new YAHOO.tool.TestCase({
+
+ name: "Examples of successful expectations",
+
+ testExpectedFunctionIsCalled : function () {
+ jack(function(){
+ jack.expect("myGlobalFunction");
+ myGlobalFunction();
+ });
+ },
+
+ testExpectedFunctionIsCalledOnObject : function () {
+ jack(function(){
+ jack.expect("myGlobalObject.functionOne");
+ myGlobalObject.functionOne();
+ });
+ }
+ });
+
+ var failingTestCase = new YAHOO.tool.TestCase({
+
+ name: "Examples of failing expectations",
+
+ testExpectedFunctionIsNotCalled : function () {
+ jack(function(){
+ jack.expect("myGlobalFunction");
+ });
+ },
+
+ testExpectedFunctionIsNotCalledOnObject : function () {
+ jack(function(){
+ jack.expect("myGlobalObject.functionOne");
+ });
+ }
+ });
+
+ var logger = new YAHOO.tool.TestLogger();
+
+ YAHOO.tool.TestRunner.add(successfulTestCase);
+ YAHOO.tool.TestRunner.add(failingTestCase);
+ YAHOO.tool.TestRunner.run();
+
+ </script>
+</body>
+</html>

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
Oops, something went wrong.

0 comments on commit 9777a6a

Please sign in to comment.