forked from keronsen/jack
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
YUI Test examples using Jack. (Not implemented yet)
- Loading branch information
Showing
3 changed files
with
10,337 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.