简体   繁体   中英

Why won't my features specs run in RSpec?

In my Rails 4 app, I'm using Rspec for testing. My directory structure is

spec
-- controllers
-- factories
-- features
-- spec_helper.rb
-- support

When I run rspec spec , it runs my tests in controllers , but not in features . I can specify rspec spec/features and they'll run, but I want to be able to run all tests under spec at once. My guess is it's not looking in features because of a configuration setting, but I don't know where this is.

I've tried different incantations of starting rspec but haven't had any luck.

Based on your feedback to the comments above, the issue is one of file naming. I've definitely been burned by that before too. By default Rspec will go through the files looking for ones ending with _spec.rb , this default behaviour is overridden if you specify the folder manually.

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