debian-mirror-gitlab/spec/support/helpers/fixture_helpers.rb

12 lines
284 B
Ruby
Raw Normal View History

2015-09-25 12:07:36 +05:30
module FixtureHelpers
2018-03-27 19:54:05 +05:30
def fixture_file(filename, dir: '')
2015-09-25 12:07:36 +05:30
return '' if filename.blank?
2018-03-17 18:26:18 +05:30
2018-03-27 19:54:05 +05:30
File.read(expand_fixture_path(filename, dir: dir))
2017-08-17 22:00:37 +05:30
end
2018-03-27 19:54:05 +05:30
def expand_fixture_path(filename, dir: '')
File.expand_path(Rails.root.join(dir, 'spec', 'fixtures', filename))
2015-09-25 12:07:36 +05:30
end
end