user3794052
user3794052

Reputation:

Helper.rb Files

In my spec folder, I have both a rails_helper.rb file and a spec_helper.rb file. If I have nothing being required for rails_helper.rb, is it safe to delete? Is there any difference or pros and cons to either? Thanks!

Upvotes: 2

Views: 218

Answers (1)

pdobb
pdobb

Reputation: 18037

Sure, you can delete rails_helper.rb if you're not referencing it. The distinction between the 2 files is more one of convention. Generally, spec_helper.rb is used by RSpec for setting up the testing environment, while rails_helper.rb is a bit of a perversion on the more conventional test_helper.rb -- which is generally used by Test::Unit and MiniTest. So, just as a matter of avoiding confusion for other/future developers you should use the file name that fits for your test suite and not have 2 of them sitting around.

Upvotes: 2

Related Questions