spec/licensee/matchers/dice_matcher_spec.rb in licensee-9.13.2 vs spec/licensee/matchers/dice_matcher_spec.rb in licensee-9.14.0
- old
+ new
@@ -4,10 +4,11 @@
subject { described_class.new(file) }
let(:mit) { Licensee::License.find('mit') }
let(:gpl) { Licensee::License.find('gpl-3.0') }
let(:agpl) { Licensee::License.find('agpl-3.0') }
+ let(:lgpl) { Licensee::License.find('lgpl-2.1') }
let(:cc_by) { Licensee::License.find('cc-by-4.0') }
let(:cc_by_sa) { Licensee::License.find('cc-by-sa-4.0') }
let(:content) { sub_copyright_info(gpl) }
let(:file) { Licensee::ProjectFiles::LicenseFile.new(content, 'LICENSE.txt') }
@@ -17,21 +18,13 @@
it 'matches' do
expect(subject.match).to eql(gpl)
end
- it 'builds a list of potential licenses' do
- expect(subject.potential_matches).to eql([agpl, gpl])
- end
-
it 'sorts licenses by similarity' do
expect(subject.matches_by_similarity[0]).to eql([gpl, 100.0])
- expect(subject.matches_by_similarity[1]).to eql([agpl, 95.6842105263158])
- end
-
- it 'returns a list of licenses above the confidence threshold' do
- expect(subject.matches_by_similarity[0]).to eql([gpl, 100.0])
- expect(subject.matches_by_similarity[1]).to eql([agpl, 95.6842105263158])
+ expect(subject.matches_by_similarity[1]).to eql([agpl, 95.28301886792453])
+ expect(subject.matches_by_similarity[2]).to eql([lgpl, 39.33253873659118])
end
it 'returns the match confidence' do
expect(subject.confidence).to be(100.0)
end