File tree Expand file tree Collapse file tree
lib/license_finder/license
spec/lib/license_finder/license Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -173,14 +173,15 @@ def cpl1
173173 License . new (
174174 short_name : 'CPL1' ,
175175 spdx_id : 'CPL-1.0' ,
176- pretty_name : 'Common Public License 1.0' ,
176+ pretty_name : 'Common Public License Version 1.0' ,
177177 other_names : [
178178 'CPL-1' ,
179179 'CPL 1' ,
180180 'CPL-1.0' ,
181181 'CPL 1.0' ,
182- 'Common Public License, v1.0' ,
183- 'COMMON PUBLIC LICENSE VERSION 1.0'
182+ 'Common Public License 1.0' ,
183+ 'Common Public License v1.0' ,
184+ 'Common Public License, v1.0'
184185 ] ,
185186 url : 'https://opensource.org/licenses/cpl1.0.txt'
186187 )
Original file line number Diff line number Diff line change 191191 end
192192end
193193
194+ describe LicenseFinder ::License , 'CPL1' do
195+ subject { described_class . find_by_name 'CPL1' }
196+
197+ it 'should have correct license url' do
198+ expect ( subject . url ) . to be 'https://opensource.org/licenses/cpl1.0.txt'
199+ end
200+
201+ it 'should be recognized by spdx_id' do
202+ expect ( described_class . find_by_name ( 'CPL-1.0' ) ) . to be subject
203+ end
204+
205+ it 'should be recognized by pretty name' do
206+ expect ( described_class . find_by_name ( 'Common Public License Version 1.0' ) ) . to be subject
207+ end
208+
209+ it 'should be recognised by other names' do
210+ expect ( described_class . find_by_name ( 'CPL-1' ) ) . to be subject
211+ expect ( described_class . find_by_name ( 'CPL 1' ) ) . to be subject
212+ expect ( described_class . find_by_name ( 'CPL-1.0' ) ) . to be subject
213+ expect ( described_class . find_by_name ( 'CPL 1.0' ) ) . to be subject
214+ expect ( described_class . find_by_name ( 'Common Public License 1.0' ) ) . to be subject
215+ expect ( described_class . find_by_name ( 'Common Public License v1.0' ) ) . to be subject
216+ expect ( described_class . find_by_name ( 'Common Public License, v1.0' ) ) . to be subject
217+ expect ( described_class . find_by_name ( 'COMMON PUBLIC LICENSE VERSION 1.0' ) ) . to be subject
218+ end
219+ end
220+
194221describe LicenseFinder ::License , 'EPL1' do
195222 subject { described_class . find_by_name 'EPL1' }
196223
You can’t perform that action at this time.
0 commit comments