Http://github.com/alexyoung/riotjs
Example:
Ruby Code
Copy Code code as follows:
Context "A new user" does
Setup {user.new}
Asserts ("that it's not yet created") {Topic.new_record?}
End
Context "A new user" does
Setup {user.new}
Asserts ("that it's not yet created") {Topic.new_record?}
End
JavaScript code
Copy Code code as follows:
Riot.run (function () {
Context (' Basic Riot functionality ', function () {
Given (' Some simple equality tests ', function () {
asserts (' 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 C Ompared ', function () {
return ' test string ';
}). Equals (' Test string ');
});
});
Given (' Yet another context ', function () {
asserts (' Equals should compare ' strings as expected ', ' Test strin G '). Equals (' Test string ');
});
});