spec/integration_spec.rb in licensee-9.14.0 vs spec/integration_spec.rb in licensee-9.14.1
- old
+ new
@@ -150,10 +150,19 @@
it 'matches' do
expect(subject.license).to eql(license)
end
end
+ context 'A BSD license with CRLF line-endings' do
+ let(:license) { Licensee::License.find('bsd-3-clause') }
+ let(:fixture) { 'crlf-bsd' }
+
+ it 'matches' do
+ expect(subject.license).to eql(license)
+ end
+ end
+
context 'BSD + PATENTS' do
let(:license) { Licensee::License.find('other') }
let(:fixture) { 'bsd-plus-patents' }
it 'returns other' do
@@ -233,10 +242,19 @@
it 'matches to GPL2' do
expect(subject.license).to eql(license)
end
end
+ context 'Artistic with Markdown formatting' do
+ let(:license) { Licensee::License.find('artistic-2.0') }
+ let(:fixture) { 'markdown-artistic' }
+
+ it 'matches to Artistic' do
+ expect(subject.license).to eql(license)
+ end
+ end
+
context 'BSD-3-Clause numbered and bulleted' do
let(:license) { Licensee::License.find('bsd-3-clause') }
let(:fixture) { 'bsd-3-lists' }
it 'determines the project is BSD-3-Clause' do
@@ -259,10 +277,28 @@
it 'matches to GPL3' do
expect(subject.license).to eql(license)
end
end
+
+ context 'Vim license file' do
+ let(:license) { Licensee::License.find('vim') }
+ let(:fixture) { 'vim' }
+
+ it 'matches to Vim' 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
+ expect(subject.license).to eql(license)
+ end
+ end
end
context 'with the license file stubbed' do
let(:project_path) { Dir.mktmpdir }
@@ -273,13 +309,14 @@
end
end
after { FileUtils.rm_rf(project_path) }
- [
+ filenames = [
'LICENSE.md', 'LICENSE.txt', 'LICENSE.md', 'LiCeNSe.Txt',
'LICENSE-MIT', 'MIT-LICENSE', 'licence', 'unlicense'
- ].each do |filename|
+ ]
+ filenames.each do |filename|
context "with a #{filename} file" do
let(:filename) { filename }
it 'matches the license file' do
expect(subject.license).to eql(license)