spec/integration_spec.rb in licensee-9.14.1 vs spec/integration_spec.rb in licensee-9.15.0

- old
+ new

@@ -38,13 +38,11 @@ let(:project_path) { Dir.mktmpdir } let(:file_path) { File.expand_path('foo.md', project_path) } before do File.write(file_path, 'bar') - if project_type == Licensee::Projects::GitProject - git_init(project_path) - end + git_init(project_path) if project_type == Licensee::Projects::GitProject end after { FileUtils.rm_rf(project_path) } it 'returns nil' do @@ -105,10 +103,18 @@ it 'matches other' do expect(subject.license).to eql(other_license) end end + context 'with Pixar Modified Apache 2.0' do + let(:fixture) { 'pixar-modified-apache' } + + it 'matches other' do + expect(subject.license).to eql(other_license) + end + end + context 'with FCPL Modified MPL' do let(:fixture) { 'fcpl-modified-mpl' } it 'matches other' do expect(subject.license).to eql(other_license) @@ -195,10 +201,19 @@ it 'returns cc0-1.0' do expect(subject.license).to eql(license) end end + context 'EUPL as published on choosealicense.com 2017-2019' do + let(:license) { Licensee::License.find('eupl-1.2') } + let(:fixture) { 'eupl-cal2017' } + + it 'returns eupl-1.2' do + expect(subject.license).to eql(license) + end + end + context 'Unlicense without optional line' do let(:license) { Licensee::License.find('unlicense') } let(:fixture) { 'unlicense-noinfo' } it 'returns unlicense' do @@ -269,10 +284,19 @@ it 'determines the project is BSD-3-Clause' do expect(subject.license).to eql(license) end end + context 'BSD-3-Clause author/owner variant' do + let(:license) { Licensee::License.find('bsd-3-clause') } + let(:fixture) { 'bsd-3-authorowner' } + + it 'determines the project is BSD-3-Clause' do + expect(subject.license).to eql(license) + end + end + context 'HTML license file' do let(:license) { Licensee::License.find('epl-1.0') } let(:fixture) { 'html' } it 'matches to GPL3' do @@ -287,10 +311,28 @@ it 'matches to Vim' do expect(subject.license).to eql(license) end end + context 'CC-BY-SA no CC licensor statement license file' do + let(:license) { Licensee::License.find('cc-by-sa-4.0') } + let(:fixture) { 'cc-by-sa-nocclicensor' } + + it 'matches to CC-BY-SA' do + expect(subject.license).to eql(license) + end + end + + context 'CC-BY-SA markdown links file' do + let(:license) { Licensee::License.find('cc-by-sa-4.0') } + let(:fixture) { 'cc-by-sa-mdlinks' } + + it 'matches to CC-BY-SA' do + expect(subject.license).to eql(license) + end + end + context 'MIT with byte order mark' do let(:license) { Licensee::License.find('mit') } let(:fixture) { 'bom' } it 'matches to MIT' do @@ -302,12 +344,10 @@ context 'with the license file stubbed' do let(:project_path) { Dir.mktmpdir } before do File.write(license_path, content) - if project_type == Licensee::Projects::GitProject - git_init(project_path) - end + git_init(project_path) if project_type == Licensee::Projects::GitProject end after { FileUtils.rm_rf(project_path) } filenames = [