AirborneAPI 测试框架

联合创作 · 2023-10-01 18:01

Airborne 是一个 RSpec 驱动的 API 测试框架,灵感来自于 frisby.js

示例代码:

require 'airborne'

describe 'sample spec' do
    it 'should validate types' do
        get 'http://example.com/api/v1/simple_get' #json api that returns { "name" : "John Doe" } 
        expect_json_types({name: :string})
    end

    it 'should validate values' do 
        get 'http://example.com/api/v1/simple_get' #json api that returns { "name" : "John Doe" } 
        expect_json({:name => "John Doe"})
    end
end
浏览 5
点赞
评论
收藏
分享

手机扫一扫分享

编辑
举报
评论
图片
表情
推荐
点赞
评论
收藏
分享

手机扫一扫分享

编辑
举报