1
4
RSpec有一个示例_status _persistence _file _path配置,该配置生成一个文件,其中包含每个单独测试的运行时间。 例如,给定以下RSpec配置/示例:
生成每个示例的状态和运行时报告: example_id | status | run_time | --------------- | ------ | ------------ | my_spec.rb[1:1] | passed | 3.02 seconds | my_spec.rb[1:2] | passed | 2.01 seconds | |
2
3
如果需要更多详细信息和/或控制格式,可以创建自定义格式设置程序。 例如,给定以下规格:
输出-文本 我们可以添加自定义格式化程序来输出完整的测试描述、状态、运行时和异常:
some thing does stuff | failed | 3.010178 | {:class=>"RuntimeError", :message=>"some error", :backtrace=>["my_spec.rb:21:in `block... (truncated for example) some thing does more stuff | passed | 2.019578 |
输出-CSV 格式化程序可以修改为输出到CSV:
Example,Status,Run Time,Exception some thing does stuff,failed,3.020176,"{:class=>""RuntimeError"", :message=>""some error"", :backtrace=>[""my_spec.rb:25:in `block...(truncated example)" some thing does more stuff,passed,2.020113, |
3
2
每个示例都会获得一个ExecutionResult对象,该对象具有
|
Stilian · 存储库设置中没有Github页面部分 2 年前 |
Kellen · 查看$卷展栏功能列表 2 年前 |
Akshit Thakur Ak · 我怎样才能把铁轨停下来? 2 年前 |
johncssjs · 将数组转换为每个元素的嵌套哈希 2 年前 |
solidsnake99 · Rails db:如何绕过验证 2 年前 |