From 8c63910daa5f8f7b2ec37cd97536c278904318cb Mon Sep 17 00:00:00 2001 From: Ben Balter Date: Sat, 22 Aug 2015 12:41:30 -0400 Subject: [PATCH] formalize whitelist --- spec/license_spec.rb | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/spec/license_spec.rb b/spec/license_spec.rb index 25efd5e..02c5469 100644 --- a/spec/license_spec.rb +++ b/spec/license_spec.rb @@ -1,5 +1,13 @@ require 'spec_helper' +# List of licenses that need not be OSI approved +LICENSE_WHITELIST = %w[ + unlicense + cc0-1.0 + wtfpl +] + + licenses.each do |license| describe "The #{license["title"]} license" do it "should have a title" do @@ -23,10 +31,11 @@ licenses.each do |license| end # CC0 and Unlicense are not OSI approved, but that's okay - unless license["id"] == "unlicense" || license["id"] == "cc0-1.0" + unless LICENSE_WHITELIST.include? license["id"] it "should be OSI approved" do spdx = find_spdx(license["id"]) - expect(spdx[1]["osiApproved"]).to eql(true) + approved = spdx[1]["osiApproved"] + expect(approved).to eql(true) end end end