diff --git a/README.md b/README.md index 87c5bb6..5cf6ebf 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,7 @@ The licenses on choosealicense.com are regularly imported to GitHub.com to be us * `project` - The repository name * `description` - The description of the repository * `year` - The current year +* `project_url` - The repository URL or other project website ## License properties diff --git a/_data/fields.yml b/_data/fields.yml index 0b5f45d..e239043 100644 --- a/_data/fields.yml +++ b/_data/fields.yml @@ -21,3 +21,6 @@ - name: year description: The current year + +- name: project_url + description: The repository URL or other project website diff --git a/spec/license_fields_spec.rb b/spec/license_fields_spec.rb new file mode 100644 index 0000000..4856f35 --- /dev/null +++ b/spec/license_fields_spec.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'license fillable fields' do + licenses.each do |license| + context "The #{license['title']} license" do + it 'should only contain supported fillable fields' do + matches = license['content'][1, 1000].scan(/\s+\[([a-z_]+)\]/) + extra_fields = matches.flatten - (fields.map { |f| f['name'] }) + expect(extra_fields).to be_empty + end + end + end +end