gpt4 book ai didi

ruby-on-rails - 捆绑 rspec/spec 失败

转载 作者:数据小太阳 更新时间:2023-10-29 08:28:10 25 4
gpt4 key购买 nike

我正在尝试使用带有命令的 rspec 运行测试套件

bundle exec rspec /spec/models/user_spec.rb

bundle exec rspec /spec/requests

导致以下错误消息:

/Users/ms/.rvm/gems/ruby-1.9.3-p286/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:780:in `load': cannot load such file -- /spec/requests (LoadError)
from /Users/ms/.rvm/gems/ruby-1.9.3-p286/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:780:in `block in load_spec_files'
from /Users/ms/.rvm/gems/ruby-1.9.3-p286/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:780:in `map'
from /Users/ms/.rvm/gems/ruby-1.9.3-p286/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:780:in `load_spec_files'
from /Users/ms/.rvm/gems/ruby-1.9.3-p286/gems/rspec-core-2.11.1/lib/rspec/core/command_line.rb:22:in `run'
from /Users/ms/.rvm/gems/ruby-1.9.3-p286/gems/rspec-core-2.11.1/lib/rspec/core/runner.rb:69:in `run'
from /Users/ms/.rvm/gems/ruby-1.9.3-p286/gems/rspec-core-2.11.1/lib/rspec/core/runner.rb:8:in `block in autorun'

我收到此错误,即使我恢复到默认测试文件,如:

require 'spec_helper'
describe User do
pending "add some examples to (or delete) #{__FILE__}"
end

我好像把 gem 搞砸了,但我不确定如何修复它。有什么想法吗?

最佳答案

删除前导正斜杠:

bundle exec rspec spec/models/user_spec.rb

关于ruby-on-rails - 捆绑 rspec/spec 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13338476/

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