This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
riotjs /
| name | age | message | |
|---|---|---|---|
| |
.gitignore | Sat Oct 17 08:20:12 -0700 2009 | |
| |
README.textile | Thu Oct 22 13:10:55 -0700 2009 | |
| |
riot.js | Fri Nov 13 07:37:46 -0800 2009 | |
| |
riotjs.html | Sat Oct 17 17:27:38 -0700 2009 | |
| |
test.js | Sat Oct 24 06:23:18 -0700 2009 |
README.textile
This is a JavaScript implementation of Riot.
It will run in a browser or in Rhino.
Example
Tests look like this:
Riot.run(function() {
context('basic riot functionality', function() {
given('some simple equality tests', function() {
asserts('a simple truth test should return true', true).isTrue();
asserts('isNull is null', null).isNull();
});
given('another context', function() {
asserts('equals should compare strings as expected', 'test string').equals('test string');
});
given('a context concerned with functions', function() {
asserts('asserts() should allow functions to be compared', function() {
return 'test string';
}).equals('test string');
});
});
given('yet another context', function() {
asserts('equals should compare strings as expected', 'test string').equals('test string');
});
});
There are a few aliases to make tests (and output) read more naturally:
context:given— Given will add “Given…” to the title in the test outputasserts:should
Assertions
equals– for example,asserts('description').equals('value')matches– matches a regextypeOf– aliased to isTypeOf, kindOfisNullisTrueraises
Riot.run
Riot.run(function() { // your tests }); just adds your tests to window.onload. If there’s already an onload handler it’ll prepend it. If there’s no window it will just run the tests.
It can also be called with no parameters to run tests defined with Riot.context. This can be used to create a set of files with tests inside a Riot.context for each file
Packaging
Packaged as a RubyGem usable via XPCOMCore-RubyGems — riotjs-xpcc.







