Created
December 13, 2010 06:55
-
-
Save erikeldridge/738737 to your computer and use it in GitHub Desktop.
files for auto-running yet tests
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
# Watchr script used in http://erikeldridge.wordpress.com/2010/12/13/running-yeti-tests-automatically-with-watchr/ | |
# watch for changes in test files | |
watch( 'test/test_.*\.html' ) { |md| | |
system('clear'); | |
system("yeti #{md[0]}") | |
} | |
# watch for changes in lib files | |
watch( 'lib/(.*)\.js' ) { |md| | |
system('clear'); | |
system("yeti test/test_#{md[1]}.html") | |
} | |
# -------------------------------------------------- | |
# Signal Handling | |
# -------------------------------------------------- | |
# Ctrl-C | |
Signal.trap('INT') { | |
abort("\n") | |
} |
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
// YUI 3 module used in http://erikeldridge.wordpress.com/2010/12/13/running-yeti-tests-automatically-with-watchr/ | |
YUI.add('example', function(Y) { | |
Y.example = 'foo'; | |
}, '1' ,{requires:[]}); |
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> | |
<html> | |
<head> | |
<!-- YUI 3 test runner used in http://erikeldridge.wordpress.com/2010/12/13/running-yeti-tests-automatically-with-watchr/ --> | |
<meta http-equiv="content-type" content="text/html; charset=utf-8"> | |
<script type="text/javascript" src="http://yui.yahooapis.com/3.2.0/build/yui/yui-min.js"></script> | |
<script type="text/javascript" src="../lib/example.js"></script> | |
</head> | |
<body class="yui3-skin-sam yui-skin-sam"> | |
<div id="console"></div> | |
<script type="text/javascript"> | |
YUI().use("example", 'test', 'console', function (Y) { | |
var testCase = new Y.Test.Case({ | |
testFoo : function () { | |
Y.Assert.areEqual('foo', Y.example, 'Y.example should be "foo"'); | |
} | |
}); | |
new Y.Console({ | |
newestOnTop : false, | |
style: 'block' | |
}).render('#console'); | |
Y.Test.Runner.add(testCase).run(); | |
}); | |
</script> | |
</body> | |
</html> |
Thanks, Marzelpan. Updating code ...
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Line 22 of test_example.html should be
Y.Assert.areEqual('foo', Y.example, 'Y.example should be "foo"');