gpt4 book ai didi

ruby-on-rails - RSpec --only-failures 错误输出

转载 作者:太空宇宙 更新时间:2023-11-03 16:42:28 25 4
gpt4 key购买 nike

当我运行 RSpec 时,它给出以下输出:

$ rspec
.F

Failures:

1) A cup of coffee with milk costs $1.25
Failure/Error: expect(coffee.price).to eq(1.25)

expected: 1.25
got: 1.0

(compared using ==)
# ./spec/coffee_spec.rb:12:in `block (3 levels) in <top (required)>'

Finished in 0.02668 seconds (files took 0.12828 seconds to load)
2 examples, 1 failure

Failed examples:

rspec ./spec/coffee_spec.rb:11 # A cup of coffee with milk costs $1.25

所以当我运行的时候

$ rspec --only-failures

输出应该是

Run options: include {:last_run_status=>"failed"}
F
« truncated »
1 example, 1 failure
Failed examples:
rspec ./spec/coffee_spec.rb:11 # A cup of coffee with milk costs $1.25

但我得到的不是这个:

Run options: include {:last_run_status=>"failed"}

All examples were filtered out


Finished in 0.00158 seconds (files took 0.13118 seconds to load)
0 examples, 0 failures

我已经将其添加到规范文件中RSpec.configure 做 |c|
c.example_status_persistence_file_path = "examples.txt"
结束

这是 examples.txt 的输出: examples.txt

知道我做错了什么吗?

最佳答案

也许这就是问题所在?

config.example_status_persistence_file_path = 'spec/examples.txt'

Cannot find 'example_status_persistence_file_path='

关于ruby-on-rails - RSpec --only-failures 错误输出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42534608/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com