mirror of https://github.com/licensee/licensee.git
Merge pull request #258 from benbalter/cargo-slash
multiple licenses in Cargo.toml obtains other rather than nil
This commit is contained in:
commit
1264dc9d7c
|
@ -1,9 +1,9 @@
|
|||
module Licensee
|
||||
module Matchers
|
||||
class Cargo < Licensee::Matchers::Package
|
||||
LICENSE_REGEX = /
|
||||
^\s*[\'\"]?license[\'\"]?\s*=\s*[\'\"]([a-z\-0-9\._]+)[\'\"]\s*
|
||||
/ix
|
||||
LICENSE_REGEX = %r{
|
||||
^\s*[\'\"]?license[\'\"]?\s*=\s*[\'\"]([a-z\-0-9\.+\/]+)[\'\"]\s*
|
||||
}ix
|
||||
|
||||
private
|
||||
|
||||
|
|
|
@ -23,7 +23,8 @@ RSpec.describe Licensee::Matchers::Cargo do
|
|||
'double quoted key' => ['"license"="mit"', 'mit'],
|
||||
'no whitespace' => ["license='mit'", 'mit'],
|
||||
'leading whitespace' => [" license = 'mit'", 'mit'],
|
||||
'other license' => ['license = "Foo"', 'other']
|
||||
'other license' => ['license = "Foo"', 'other'],
|
||||
'multiple licenses' => ['license = "Apache-2.0/MIT"', 'other']
|
||||
}.each do |description, license_declaration_and_key|
|
||||
context "with a #{description}" do
|
||||
let(:content) { license_declaration_and_key[0] }
|
||||
|
|
Loading…
Reference in New Issue