main
1# frozen_string_literal: true
2
3RSpec.configure do |config|
4 config.include(Module.new do
5 def fixture_file(path)
6 Pathname.new(__FILE__).parent.join('../fixtures', path)
7 end
8
9 def fixture_file_content(path)
10 fixture_file(path).read
11 end
12
13 def license_file(id)
14 fixture_file_content("spdx/text/#{id}.txt")
15 end
16
17 def to_path(path)
18 Pathname.new(path)
19 end
20
21 def within_tmp_dir
22 Dir.mktmpdir do |directory|
23 Dir.chdir(directory) do
24 yield Pathname.new(directory)
25 end
26 end
27 end
28 end)
29end