最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

Riot.js 快速的JavaScript單元測試框架

 更新時間:2009年11月09日 19:11:10   作者:  
Riot是一個快速,富有表現(xiàn)力,上下文驅(qū)動 的單元測試框架。最初是用于Ruby的單元測試,最近作者Alex Young又實現(xiàn)了Riot的JavaScript版- Riot.js。
http://github.com/alexyoung/riotjs
示例:
Ruby代碼
復制代碼 代碼如下:

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代碼
復制代碼 代碼如下:

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');
});
});

相關(guān)文章

最新評論

福州市| 大洼县| 新龙县| 广饶县| 徐闻县| 扶绥县| 高青县| 饶河县| 牡丹江市| 府谷县| 兴义市| 岱山县| 星子县| 绥芬河市| 克拉玛依市| 株洲县| 武平县| 邯郸县| 衡阳市| 清徐县| 宜都市| 务川| 忻城县| 靖宇县| 揭阳市| 宁武县| 安顺市| 安平县| 四会市| 和硕县| 通辽市| 象州县| 五家渠市| 武穴市| 都兰县| 新建县| 阿瓦提县| 长海县| 新乡县| 台山市| 哈巴河县|