簡體   English   中英

將 RSpec 升級到版本 3 后,我無法再運行單個規范文件

[英]after upgrading RSpec to version 3 I can't run single spec file anymore

我們正在將 rails 從 3.4 升級到 4.2。 當我們將 rspec 升級到最新版本時,即使在強制 rspec 只運行一個規范之后,它也會運行大約 900 個測試,但我的文件只有兩個上下文。 我使用類似於這個命令的東西:

rspec spec/myfile_spec.rb

有什么問題? 我可以在 spec_helper 中修復它嗎?

希望你沒事! 您可以通過以下命令運行您想要的規范。

# Default: Run all spec files (i.e., those matching spec/**/*_spec.rb)
$ bundle exec rspec

# Run all spec files in a single directory (recursively)
$ bundle exec rspec spec/models

# Run a single spec file
$ bundle exec rspec spec/controllers/accounts_controller_spec.rb

# Run a single example from a spec file (by line number)
$ bundle exec rspec spec/controllers/accounts_controller_spec.rb:8

# See all options for running specs
$ bundle exec rspec --help

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM