From ff95f085912b1ba60931286788acfadf8b7aa0b7 Mon Sep 17 00:00:00 2001 From: lionellloh Date: Tue, 30 Jun 2020 22:08:36 +0800 Subject: [PATCH] audit test: modified code for reading json file --- Library/Homebrew/test/dev-cmd/audit_spec.rb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Library/Homebrew/test/dev-cmd/audit_spec.rb b/Library/Homebrew/test/dev-cmd/audit_spec.rb index 54ead437d0..0cce4cbf92 100644 --- a/Library/Homebrew/test/dev-cmd/audit_spec.rb +++ b/Library/Homebrew/test/dev-cmd/audit_spec.rb @@ -81,12 +81,9 @@ module Homebrew describe "#audit_license" do let(:spdx_data) { - full_path = File.join(File.dirname(__FILE__), "../../data/spdx.json") - File.open(full_path, "r") do |f| - JSON.parse(f.read) - end + JSON.parse Pathname(File.join(File.dirname(__FILE__), "../../data/spdx.json")).read } - + let(:custom_spdx_id) { "zzz" } let(:standard_mismatch_spdx_id) { "0BSD" }