Merge pull request #14980 from reitermarkus/spdx-test

Simplify SPDX test.
This commit is contained in:
Mike McQuaid 2023-03-15 12:15:08 -04:00 committed by GitHub
commit 78e5bd53eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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