# frozen_string_literal: true module FixtureFileHelper def fixture_file_content(path, data = {}) content = IO.read(fixture_file(path)) return content unless path.end_with?('.erb') ERB .new(content) .result(OpenStruct.new(data).send(:binding)) end def fixture_file(path) File.expand_path("spec/fixtures/#{path}") end end