I would like to create and use more than one "spec_helper.rb" to set up different block of codes for each project.

Is that possible? If so, how can I call a specific "spec_helper.rb" in my test file?


spec_helper.rb is not special, it's just a ruby file that you then require from other files (generally the files that define your specs). You can change the name (or have multiple differently named files) that you then require when needed.

Beyond that your question asking about setting up different blocks of code for different projects doesn't make a lot of sense since different projects would each have their own spec_helper.rb by default.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.