Http://github.com/alexyoung/riotjs
Example:
Ruby code
Copy codeThe Code is as follows:
Context "a new user" do
Setup {User. new}
Asserts ("that it is not yet created") {topic. new_record? }
End
Context "a new user" do
Setup {User. new}
Asserts ("that it is not yet created") {topic. new_record? }
End
Javascript code
Copy codeThe Code is as follows:
Riot. run (function (){
Context ('basic riot functionality ', function (){
Given ('some simple equality tests', function (){
Asserts ('a simple truth test shocould return true', true). isTrue ();
Asserts ('isnull is null', null). isNull ();
});
Given ('another context', function (){
Asserts ('equals shoshould compare strings as expected', 'test string'). equals ('test string ');
});
Given ('a context concerned with functions ', function (){
Asserts ('asserts () shocould allow functions to be computed', function (){
Return 'test string ';
}). Equals ('test string ');
});
});
Given ('yunanother context', function (){
Asserts ('equals shoshould compare strings as expected', 'test string'). equals ('test string ');
});
});