rspec_json_schema_matcher:使用JSON模式验证规范中的JSON

时间:2021-05-21 14:34:37
【文件属性】:
文件名称:rspec_json_schema_matcher:使用JSON模式验证规范中的JSON
文件大小:9KB
文件格式:ZIP
更新时间:2021-05-21 14:34:37
Ruby RSpec JSON模式匹配器 使用在规范中验证JSON: it "returns a valid user resource" do expect ( response . body ) . to match_schema "user" end 方便测试基于JSON的Web API! 安装 将此添加到应用程序的Gemfile中: group :test do gem "rspec_json_schema_matcher" end 然后安装gem: $ bundle 用法 您可能需要阅读我的。 提供一个名为match_schema RSpec匹配器,该匹配器接受不带.json扩展名的JSON模式的相对路径。 匹配器假定您的模式存储在./spec/support/schemas或其子目录中。 例如,如果要使用./spec/support/schemas/user
【文件预览】:
rspec_json_schema_matcher-master
----.gitignore(87B)
----README.md(2KB)
----LICENSING.md(774B)
----bin()
--------console(350B)
--------setup(115B)
----Gemfile(110B)
----rspec_json_schema_matcher.gemspec(1005B)
----.rspec(31B)
----spec()
--------support()
--------rspec_json_schema_matcher_spec.rb(963B)
--------spec_helper.rb(91B)
----lib()
--------rspec_json_schema_matcher()
--------rspec_json_schema_matcher.rb(885B)
----Rakefile(117B)
----circle.yml(504B)

网友评论