Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
files for auto-running yet tests
# 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")
}
// 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:[]});
<!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>
@Marzelpan

This comment has been minimized.

Copy link

@Marzelpan Marzelpan commented Dec 14, 2010

Line 22 of test_example.html should be
Y.Assert.areEqual('foo', Y.example, 'Y.example should be "foo"');

@erikeldridge

This comment has been minimized.

Copy link
Owner Author

@erikeldridge erikeldridge commented Dec 14, 2010

Thanks, Marzelpan. Updating code ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment