简体   繁体   中英

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

We are in the process of upgrading rails from 3.4 to 4.2. When we upgraded the rspec to the latest version, even after forcing the rspec to run only one spec it runs around 900 tests but my file only hast two contexts. I use something similar to this command :

rspec spec/myfile_spec.rb

What can be wrong? Is it something that I can fix in spec_helper? I d

Hope you are fine! You can just run the spec you want by the following commands.

# 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM