When developing gems in Ruby, I almost always need a file in which I can customize RSpec to my needs, and maybe before you do this, some helper modules will need to be available in all my spec examples.
Rails applications use a file called spec/spec_helper.rb for this. It annoys me that in a typical Rails environment, you need to require this spec_helper.rb file in every file that contains examples for loading it. I used to have a lot of problems with this related to changing boot paths and relative requirements in sample files.
Now for my gems, I would like to ask RSpec to require the spec_helper.rb file before downloading any of the sample files. Regardless of the fact, if I call the rspec executable or the rake spec job, which I can define in my Rakefile.
I know that I can tell RSpec only the location of my spec_helper.rb, this spec_helper.rb requires all the sample files manually, but I would also like to avoid the additional maintenance of this approach.
Is there a better way to do this?
ruby rspec rspec2
aef Feb 21 2018-11-21T00: 00Z
source share