I have a RSpec test for a class in /lib/classes which needs access to a zip file (no upload). The file is stored in /spec/fixtures/files/test.zip. How do I input the correct path so it’s environment agnostic, i.e. without absolute path?
I have a RSpec test for a class in /lib/classes which needs access to
Share
As far as I know (from looking every month or two) there is no better way that building something in
spec_helperthat uses the__FILE__value to grab the path to a know bit of content, then build your own helpers on top of that.You can obviously use a path relative to
__FILE__in the individual*_spec.rbfile as well.