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

14 lines
315 B
Ruby
Raw Permalink Normal View History

2019-10-12 21:52:04 +05:30
# frozen_string_literal: true
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: '')
2023-05-27 22:25:52 +05:30
File.expand_path(rails_root_join(dir, 'spec', 'fixtures', filename))
2015-09-25 12:07:36 +05:30
end
end