From d01065b09a3bbf9918f0b46f38e38a3d4aa7eb85 Mon Sep 17 00:00:00 2001 From: Ben Balter Date: Sun, 8 Oct 2017 18:34:03 -0700 Subject: [PATCH] change the regex...to require the field be surrounded by whitespace? The reason for the test was because some licenses had name and others had author, meaning in GitHub.com the inconsistency would cause the fields not to be interpolated. Copied from https://github.com/github/choosealicense.com/pull/527#discussion_r140502928 --- spec/license_fields_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/license_fields_spec.rb b/spec/license_fields_spec.rb index 4215f37..1c0d409 100644 --- a/spec/license_fields_spec.rb +++ b/spec/license_fields_spec.rb @@ -6,7 +6,7 @@ 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'].scan(/\[([a-z]+)\]/) + matches = license['content'].scan(/\s+\[([a-z]+)\]\s+/) extra_fields = matches.flatten - (fields.map { |f| f['name'] }) expect(extra_fields).to be_empty end