From ade0beec177e52dcf0fb6accd8dc2332cc40e868 Mon Sep 17 00:00:00 2001 From: Mike Linksvayer Date: Mon, 8 Feb 2016 10:25:06 -0800 Subject: [PATCH 1/2] Test that only open licenses are included per https://github.com/github/choosealicense.com/blob/gh-pages/CONTRIBUTING.md#adding-a-license - check that all licenses have minimum permissions - remove non-open (and unused) forbiddens - closes #1 with confidence --- _data/rules.yml | 6 ------ spec/license_spec.rb | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/_data/rules.yml b/_data/rules.yml index d119911..2970878 100644 --- a/_data/rules.yml +++ b/_data/rules.yml @@ -42,9 +42,3 @@ forbidden: - description: Software is provided without warranty and the software author/license owner cannot be held liable for damages. label: Hold Liable tag: no-liability -- description: This software may not be modified. - label: Modification - tag: modifications -- description: You may not distribute this software. - label: Distribution - tag: distribution diff --git a/spec/license_spec.rb b/spec/license_spec.rb index 87ef083..4c55d6e 100644 --- a/spec/license_spec.rb +++ b/spec/license_spec.rb @@ -27,6 +27,22 @@ describe "licenses" do expect(approved_licenses).to include(id), "See https://git.io/vzCTV." end end + + context "minimum permissions" do + permissions = license["permitted"] + it "should allow commercial use" do + expect(permissions).to include("commercial-use") + end + it "should allow modification" do + expect(permissions).to include("modifications") + end + it "should allow distribution" do + expect(permissions).to include("distribution") + end + it "should allow private use" do + expect(permissions).to include("private-use") + end + end end end end From 14896c3fc8b4ce618cca6f58a83263753deb463f Mon Sep 17 00:00:00 2001 From: Mike Linksvayer Date: Mon, 8 Feb 2016 14:02:07 -0800 Subject: [PATCH 2/2] style feedback from @benbalter --- spec/license_spec.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/spec/license_spec.rb b/spec/license_spec.rb index 4c55d6e..fd072de 100644 --- a/spec/license_spec.rb +++ b/spec/license_spec.rb @@ -29,16 +29,19 @@ describe "licenses" do end context "minimum permissions" do - permissions = license["permitted"] + let(:permissions) { license["permitted"] } it "should allow commercial use" do expect(permissions).to include("commercial-use") end + it "should allow modification" do expect(permissions).to include("modifications") end + it "should allow distribution" do expect(permissions).to include("distribution") end + it "should allow private use" do expect(permissions).to include("private-use") end