最新国产好看的视频,伊人天堂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代碼
復(fù)制代碼 代碼如下:

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代碼
復(fù)制代碼 代碼如下:

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)文章

最新評論

财经| 巴塘县| 上饶市| 五大连池市| 香港| 平塘县| 吴旗县| 蓬安县| 阿拉善左旗| 虞城县| 株洲县| 栾城县| 封开县| 河津市| 平塘县| 中阳县| 革吉县| 定州市| 那曲县| 哈密市| 双鸭山市| 沭阳县| 河西区| 沿河| 临江市| 库伦旗| 桂林市| 尼木县| 额敏县| 佛冈县| 上饶市| 田阳县| 方正县| 桦南县| 清新县| 射洪县| 乌恰县| 新泰市| 稷山县| 稻城县| 鸡西市|