Simplify SPDX test.

This commit is contained in:
Markus Reiter 2023-03-15 14:29:04 +01:00
parent 0d5e291fe1
commit 9d415e22da
No known key found for this signature in database
GPG Key ID: 245293B51702655B

View File

@ -33,17 +33,12 @@ describe SPDX do
end
describe ".download_latest_license_data!", :needs_network do
let(:tmp_json_path) { Pathname.new(TEST_TMPDIR) }
after do
FileUtils.rm_f tmp_json_path/"spdx_licenses.json"
FileUtils.rm_f tmp_json_path/"spdx_exceptions.json"
end
let(:download_dir) { mktmpdir }
it "downloads latest license data" do
described_class.download_latest_license_data! to: tmp_json_path
expect(tmp_json_path/"spdx_licenses.json").to exist
expect(tmp_json_path/"spdx_exceptions.json").to exist
described_class.download_latest_license_data! to: download_dir
expect(download_dir/"spdx_licenses.json").to exist
expect(download_dir/"spdx_exceptions.json").to exist
end
end