spec/licensee/matchers/gemspec_matcher_spec.rb in licensee-9.6.0 vs spec/licensee/matchers/gemspec_matcher_spec.rb in licensee-9.7.0
- old
+ new
@@ -16,11 +16,13 @@
{
'as spec.' => "spec.license = 'mit'",
'double quotes' => 's.license = "mit"',
'no whitespace' => "s.license='mit'",
- 'uppercase' => "s.license = 'MIT'"
+ 'uppercase' => "s.license = 'MIT'",
+ 'array' => "s.licenses = ['mit']",
+ 'frozen' => "s.license = 'mit'.freeze"
}.each do |description, license_declaration|
context "with a #{description} declaration" do
let(:content) { license_declaration }
it 'matches' do
@@ -37,9 +39,17 @@
end
end
context 'an unknown license' do
let(:content) { "s.license = 'foo'" }
+
+ it 'returns other' do
+ expect(subject.match).to eql(Licensee::License.find('other'))
+ end
+ end
+
+ context 'a licenses property with multiple licenses' do
+ let(:content) { "s.licenses = ['mit', 'bsd-3-clause']" }
it 'returns other' do
expect(subject.match).to eql(Licensee::License.find('other'))
end
end