- 授权协议: MIT
- 开发语言: Ruby
- 操作系统: 跨平台
- 软件首页: https://github.com/myronmarston/vcr
软件介绍
VCR 是 Ruby 开发的一个用于简化 HTTP 交互测试的工具包。
示例代码:
require 'rubygems'
require 'test/unit'
require 'vcr'
VCR.configure do |c|
c.cassette_library_dir = 'fixtures/vcr_cassettes'
c.hook_into :webmock # or :fakeweb
end
class VCRTest < Test::Unit::TestCase
def test_example_dot_com
VCR.use_cassette('synopsis') do
response = Net::HTTP.get_response(URI('http://www.iana.org/domains/example/'))
assert_match /Example Domains/, response.body
end
end
end
