As part of RSpec, I need to reference the file contained in the gem. I am depending on (name it gem foo). I control gem foo, so I can make changes to it as needed.
The gem 'foo' contains the file I need to refer to in the rspec spec. Is there a stable enough RubyGem or Bundler API to define the base directory foo?
Assuming 'foo' is already required in my Gemfile: in the Gemfile:
gem 'foo'
I want to do something like this (in something_spec.rb):
filename = File.expand_path('examples/xml/result.xml', Gem.gem_base_path('foo'))
What is the gem_base_path API call?
source
share