Http://github.com/alexyoung/riotjs
Example:
Ruby Code
Copy code The 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 codeCopy 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 ');
});
});