开发者

Where is the .rspec configuration file located exactly?

Working through the Ruby on Rails Tutorial and stuck here "To run RSpec and Spork with Autotest, we need to configure RSpec to use the --drb option by default, which we can arrange by adding it to the .rspec configuration file in the Rails root directory (Listing 3.14)."

When I search my file structure I can not find a single file with .rspec file extension? How do I access this fi开发者_JS百科le to update the configuration?


If you are using a mac you will not see these files just like you will not see the gitignore file

what you need to do in order to access this file is from the root directory of the app just click (command line)

mate .rspec

this will open the file if it's there, and if not, it will create it.


If you add gem 'rspec-rails' to your Gemfile, you can use the rails g rspec:install command. This will create the .rspec file in the root of the Rails application. It will also create a spec folder and a file inside it 'spec_helper.rb'

If you do not want to write this command, you may simply create the file manually. If you are using a linux machine, the hidden files can be seen with a <ctrl-h> command. You may also try the ls -a in any unix terminal to see all hidden and non hidden files.


Files on mac that begin with . are not shown by default. In Terminal, if you type ls -a you'll see all of the "dotfiles" that are in the folder.

If this file doesn't exist yet (it probably doesn't) then you just need to create it using your favorite editor.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜